Admins can declare an email as valid
This commit is contained in:
parent
c86ff67884
commit
95fec7c0da
|
@ -203,7 +203,7 @@ class UserUpdateView(LoginRequiredMixin, UpdateView):
|
|||
context["title"] = _("Update user {user}").format(user=str(self.object.registration))
|
||||
context["registration_form"] = user.registration.form_class(data=self.request.POST or None,
|
||||
instance=self.object.registration)
|
||||
if not user.registration.is_admin:
|
||||
if not self.request.user.registration.is_admin:
|
||||
if "team" in context["registration_form"].fields:
|
||||
del context["registration_form"].fields["team"]
|
||||
del context["registration_form"].fields["email_confirmed"]
|
||||
|
@ -214,7 +214,7 @@ class UserUpdateView(LoginRequiredMixin, UpdateView):
|
|||
user = form.instance
|
||||
registration_form = user.registration.form_class(data=self.request.POST or None,
|
||||
instance=self.object.registration)
|
||||
if not user.registration.is_admin:
|
||||
if not self.request.user.registration.is_admin:
|
||||
if "team" in registration_form.fields:
|
||||
del registration_form.fields["team"]
|
||||
del registration_form.fields["email_confirmed"]
|
||||
|
|
Loading…
Reference in New Issue