1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-02-11 18:51:19 +00:00

Update file views.py

This commit is contained in:
thomasl 2025-02-09 16:19:26 +01:00
parent bfd865b3e3
commit 056c4029f8

View File

@ -83,7 +83,7 @@ class UserUpdateView(ProtectQuerysetMixin, LoginRequiredMixin, UpdateView):
# Delete the fields for which the user does not have the permission to modify
for field_name in fields_to_check:
if not PermissionBackend.check_perm(self.request, f"member.change_profile_{field_name}", context['user_object'].profile):
profile_form.fields[field_name].widget.attrs['readonly'] = True
profile_form.fields[field_name].widget = forms.HiddenInput()
context['profile_form'] = profile_form