diff options
author | Prabhu Ramachandran | 2017-05-05 17:47:27 +0530 |
---|---|---|
committer | GitHub | 2017-05-05 17:47:27 +0530 |
commit | b6993d79ae2f0d18375555f5ada72b52a3a2e066 (patch) | |
tree | 19326254303a5ff03697371ed198f89e1145db9b /yaksh/forms.py | |
parent | 4cd448769c6cc230b7a33a1848cc45873b578468 (diff) | |
parent | d7e6430d8c48381c6660906ab3a96251824f9031 (diff) | |
download | online_test-b6993d79ae2f0d18375555f5ada72b52a3a2e066.tar.gz online_test-b6993d79ae2f0d18375555f5ada72b52a3a2e066.tar.bz2 online_test-b6993d79ae2f0d18375555f5ada72b52a3a2e066.zip |
Merge pull request #290 from adityacp/email_verifcation_testing
Email verification testing
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r-- | yaksh/forms.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py index 5dd56a2..3459be9 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -10,6 +10,7 @@ from taggit.managers import TaggableManager from taggit.forms import TagField from django.forms.models import inlineformset_factory from django.db.models import Q +from django.utils import timezone from textwrap import dedent try: from string import letters @@ -18,7 +19,7 @@ except ImportError: from string import punctuation, digits import datetime import pytz -from .email_verification import generate_activation_key +from .send_emails import generate_activation_key languages = ( ("select", "Select Language"), @@ -146,11 +147,8 @@ class UserRegisterForm(forms.Form): new_profile.is_email_verified = True else: new_profile.activation_key = generate_activation_key(new_user.username) - new_profile.key_expiry_time = datetime.datetime.strftime( - datetime.datetime.now() + \ - datetime.timedelta(minutes=20), - "%Y-%m-%d %H:%M:%S" - ) + new_profile.key_expiry_time = timezone.now() + \ + timezone.timedelta(minutes=20) new_profile.save() return u_name, pwd, new_user.email, new_profile.activation_key |