mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-02-20 23:21:21 +00:00
Fix some errors
This commit is contained in:
parent
238ba78f4f
commit
e5567c6c8a
@ -63,8 +63,9 @@ class ProfileForm(forms.ModelForm):
|
|||||||
self.add_error("promotion", _("You can't register to the note if you come from the future."))
|
self.add_error("promotion", _("You can't register to the note if you come from the future."))
|
||||||
return promotion
|
return promotion
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, request=None, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
self.request = request
|
||||||
self.fields['address'].widget.attrs.update({"placeholder": "4 avenue des Sciences, 91190 GIF-SUR-YVETTE"})
|
self.fields['address'].widget.attrs.update({"placeholder": "4 avenue des Sciences, 91190 GIF-SUR-YVETTE"})
|
||||||
self.fields['promotion'].widget.attrs.update({"max": timezone.now().year})
|
self.fields['promotion'].widget.attrs.update({"max": timezone.now().year})
|
||||||
|
|
||||||
|
@ -74,7 +74,8 @@ class UserUpdateView(ProtectQuerysetMixin, LoginRequiredMixin, UpdateView):
|
|||||||
form.fields['email'].help_text = _("This address must be valid.")
|
form.fields['email'].help_text = _("This address must be valid.")
|
||||||
|
|
||||||
profile_form = self.profile_form(instance=context['user_object'].profile,
|
profile_form = self.profile_form(instance=context['user_object'].profile,
|
||||||
data=self.request.POST if self.request.POST else None)
|
data=self.request.POST if self.request.POST else None,
|
||||||
|
self.request = request)
|
||||||
if not self.object.profile.report_frequency:
|
if not self.object.profile.report_frequency:
|
||||||
del profile_form.fields["last_report"]
|
del profile_form.fields["last_report"]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user