diff options
author | ashwinishinde | 2015-07-27 14:35:36 +0530 |
---|---|---|
committer | ashwinishinde | 2015-07-27 14:35:36 +0530 |
commit | 3bece40212e6824108703ed5749a04fc976c0d5e (patch) | |
tree | 48646c9529475182381d6e19ccdd474c49d73dd2 /forums | |
parent | 028f5782c4f284d03d16685c07f232f14e47c2db (diff) | |
download | FOSSEE-Forum-3bece40212e6824108703ed5749a04fc976c0d5e.tar.gz FOSSEE-Forum-3bece40212e6824108703ed5749a04fc976c0d5e.tar.bz2 FOSSEE-Forum-3bece40212e6824108703ed5749a04fc976c0d5e.zip |
Subject: Should not accept same Email-id
Description:
Diffstat (limited to 'forums')
-rw-r--r-- | forums/forms.py | 7 | ||||
-rw-r--r-- | forums/views.py | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/forums/forms.py b/forums/forms.py index 05f0d56..bf77a28 100644 --- a/forums/forms.py +++ b/forums/forms.py @@ -105,7 +105,12 @@ class RegisterForm(forms.Form): pass - + def clean_email(self): + try: + User.objects.get(email=self.cleaned_data['email']) + raise forms.ValidationError(_("This email is already taken.")) + except User.DoesNotExist: + pass diff --git a/forums/views.py b/forums/views.py index 185cc84..ebb44ca 100644 --- a/forums/views.py +++ b/forums/views.py @@ -143,7 +143,7 @@ def account_view_profile(request, username): def send_registration_confirmation(user): p = Profile.objects.get(user=user) - user.email = "ashwinids03@gmail.com" + # Sending email when an answer is posted subject = 'Account Active Notification' message = """Dear {0}, @@ -158,6 +158,7 @@ def send_registration_confirmation(user): "http://fossee.in", "http://forums.fossee.in/accounts/confirm/" + str(p.confirmation_code) + "/" + user.username ) + print user.email email = EmailMultiAlternatives( subject, message, 'sysads@fossee.in', to = [user.email], bcc = [], cc = [], |