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 | |
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:
-rw-r--r-- | category_names.txt | 12 | ||||
-rw-r--r-- | category_names1.txt | 10 | ||||
-rw-r--r-- | forums/forms.py | 7 | ||||
-rw-r--r-- | forums/views.py | 3 |
4 files changed, 19 insertions, 13 deletions
diff --git a/category_names.txt b/category_names.txt index 0403f3a..226ec07 100644 --- a/category_names.txt +++ b/category_names.txt @@ -1 +1,11 @@ -Scilab-arduino +Scilab +Python +FreeEDA +OpenFOAM +OR-Tools +Osdag +SBHS +Netbook +Sandhi +DWSIM +scilab-arduino diff --git a/category_names1.txt b/category_names1.txt deleted file mode 100644 index d716a03..0000000 --- a/category_names1.txt +++ /dev/null @@ -1,10 +0,0 @@ -Scilab -Python -FreeEDA -OpenFOAM -OR-Tools -Osdag -SBHS -Netbook -Sandhi -DWSIM 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 = [], |