Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Prevented user to change her email to same address

  • Loading branch information...
commit 5060e98a3592985eb78124859c51c9ea11fa1c4d 1 parent ba4ac84
@anttihirvonen authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 dotmembership/apps/members/forms.py
View
4 dotmembership/apps/members/forms.py
@@ -33,6 +33,10 @@ class Meta:
model = Member
fields = ("email",)
+ def clean_email(self):
+ if self.instance.email == self.cleaned_data['email']:
+ raise forms.ValidationError(_(u"Syöttämäsi osoite on sama kuin aiempi."))
+
def send_notification(self, user=None, instance=None):
subject = _(u"Hyväksy uusi sähköpostiosoite")
body = render_to_string("members/mails/change_email.txt",
Please sign in to comment.
Something went wrong with that request. Please try again.