"user.user_permissions.remove" expects a permission object. Or the pk of
that object. Hence, the TypeError.

On Mon, Dec 3, 2018 at 9:02 PM Gaurav Tomer <tomergaurav1...@gmail.com>
wrote:

> I was trying to remove permission of a user using remove utility as below -
>
> user = User.objects.get(id=user_id)
> user.user_permissions.remove("delete_polls")
>
> Then it raises TypeError:invalid literal for int with base 10:
> 'delete_polls'
>
>
> Do I need to pass index here?
>
> As it sounds kind of static way to do so. Is there anything I am missing
> here?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAb%3DBQodEv2hZyi5aRka5oD_eQwCnkBxcpQz5cJpnHEc33o5DQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAAb%3DBQodEv2hZyi5aRka5oD_eQwCnkBxcpQz5cJpnHEc33o5DQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAL1UH0tmmGD7DfvSStABPQkce7_fJV31OGOCHLMKRNbrW2kcgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to