i’m trying to update user’s permission using UpdateView and fields=[‘user_permissions’], in my html i named my select input element like this name=‘user_permissions’ but nothing works. but for the other fields like email everything is working.
Welcome @kibabu !
For us to try and help you with this, we’re going to need to see the code involved.
Are you using a custom user model, or the system default user model?
What does your form and view look like?
Keep in mind that the standard user model has a many-to-many relationship with permissions, and so is handled differently than other fields.
i’m using the standard model
class UpdateUser(UpdateView):
model = User
fields = [
"email",
"is_superuser",
"is_active",
"is_staff",
"user_permissions",
]
template_name = "canalplus/update.html"
success_url = reverse_lazy('canalplus:list')