mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-10-31 07:49:57 +01:00 
			
		
		
		
	Fix some errors
This commit is contained in:
		| @@ -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"] | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user