Permalink
Browse files

Prevented user to change her email to same address

  • Loading branch information...
1 parent ba4ac84 commit 5060e98a3592985eb78124859c51c9ea11fa1c4d @anttihirvonen committed Sep 22, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 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",

0 comments on commit 5060e98

Please sign in to comment.