diff options
author | Prabhu Ramachandran | 2016-07-12 08:50:57 -0500 |
---|---|---|
committer | GitHub | 2016-07-12 08:50:57 -0500 |
commit | 73552024136f906f2af0c5f2737216f2db1310e9 (patch) | |
tree | bcf980d4422dec9bd896638999b77b5a4149839f | |
parent | f1f9818a397a954acf3bce134ea278fafca81a08 (diff) | |
parent | 2725f202757694d966d00c413b327bb163fba67f (diff) | |
download | online_test-73552024136f906f2af0c5f2737216f2db1310e9.tar.gz online_test-73552024136f906f2af0c5f2737216f2db1310e9.tar.bz2 online_test-73552024136f906f2af0c5f2737216f2db1310e9.zip |
Merge pull request #115 from maheshgudi/master
minor changes in timezone and change password templates
-rw-r--r-- | yaksh/models.py | 11 | ||||
-rw-r--r-- | yaksh/templates/register/password_change_done.html (renamed from yaksh/templates/registration/password_change_done.html) | 0 | ||||
-rw-r--r-- | yaksh/templates/register/password_change_form.html (renamed from yaksh/templates/registration/password_change_form.html) | 0 | ||||
-rw-r--r-- | yaksh/templates/register/password_reset_complete.html (renamed from yaksh/templates/registration/password_reset_complete.html) | 0 | ||||
-rw-r--r-- | yaksh/templates/register/password_reset_confirm.html (renamed from yaksh/templates/registration/password_reset_confirm.html) | 0 | ||||
-rw-r--r-- | yaksh/templates/register/password_reset_done.html (renamed from yaksh/templates/registration/password_reset_done.html) | 0 | ||||
-rw-r--r-- | yaksh/templates/register/password_reset_form.html (renamed from yaksh/templates/registration/password_reset_form.html) | 0 | ||||
-rw-r--r-- | yaksh/tests.py | 2 | ||||
-rw-r--r-- | yaksh/urls.py | 13 |
9 files changed, 20 insertions, 6 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index c48eef1..4ee6141 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -163,7 +163,9 @@ class Profile(models.Model): department = models.CharField(max_length=64) position = models.CharField(max_length=64) timezone = models.CharField(max_length=64, - choices=[(tz, tz) for tz in pytz.common_timezones]) + default=pytz.utc.zone, + choices=[(tz, tz) for tz in pytz.common_timezones] + ) ############################################################################### @@ -334,13 +336,16 @@ class QuizManager(models.Manager): trial_quiz.pk = None trial_quiz.description = trial_quiz_name trial_quiz.is_trial = True - trial_quiz.time_between_attempts = 0 trial_quiz.prerequisite = None if godmode: + trial_quiz.time_between_attempts = 0 trial_quiz.duration = 1000 + trial_quiz.attempts_allowed = -1 trial_quiz.active = True trial_quiz.start_date_time = timezone.now() - trial_quiz.end_date_time = datetime(2199, 1, 1, 0, 0, 0, 0) + trial_quiz.end_date_time = datetime(2199, 1, 1, 0, 0, 0, 0, + tzinfo=pytz.utc + ) trial_quiz.save() return trial_quiz diff --git a/yaksh/templates/registration/password_change_done.html b/yaksh/templates/register/password_change_done.html index fef07d1..fef07d1 100644 --- a/yaksh/templates/registration/password_change_done.html +++ b/yaksh/templates/register/password_change_done.html diff --git a/yaksh/templates/registration/password_change_form.html b/yaksh/templates/register/password_change_form.html index 48292f8..48292f8 100644 --- a/yaksh/templates/registration/password_change_form.html +++ b/yaksh/templates/register/password_change_form.html diff --git a/yaksh/templates/registration/password_reset_complete.html b/yaksh/templates/register/password_reset_complete.html index 0801d3b..0801d3b 100644 --- a/yaksh/templates/registration/password_reset_complete.html +++ b/yaksh/templates/register/password_reset_complete.html diff --git a/yaksh/templates/registration/password_reset_confirm.html b/yaksh/templates/register/password_reset_confirm.html index 5566499..5566499 100644 --- a/yaksh/templates/registration/password_reset_confirm.html +++ b/yaksh/templates/register/password_reset_confirm.html diff --git a/yaksh/templates/registration/password_reset_done.html b/yaksh/templates/register/password_reset_done.html index ace3cc9..ace3cc9 100644 --- a/yaksh/templates/registration/password_reset_done.html +++ b/yaksh/templates/register/password_reset_done.html diff --git a/yaksh/templates/registration/password_reset_form.html b/yaksh/templates/register/password_reset_form.html index 0dbaf09..0dbaf09 100644 --- a/yaksh/templates/registration/password_reset_form.html +++ b/yaksh/templates/register/password_reset_form.html diff --git a/yaksh/tests.py b/yaksh/tests.py index e65e699..8bd2dda 100644 --- a/yaksh/tests.py +++ b/yaksh/tests.py @@ -230,7 +230,7 @@ class QuizTestCases(unittest.TestCase): self.assertEqual(trial_quiz.duration, 1000) self.assertTrue(trial_quiz.active) self.assertEqual(trial_quiz.end_date_time, - datetime(2199, 1, 1, 0, 0, 0, 0) + datetime(2199, 1, 1, 0, 0, 0, 0, tzinfo=pytz.utc) ) self.assertEqual(trial_quiz.time_between_attempts, 0) diff --git a/yaksh/urls.py b/yaksh/urls.py index 7a41f95..cd97dd4 100644 --- a/yaksh/urls.py +++ b/yaksh/urls.py @@ -6,18 +6,27 @@ from django.contrib.auth.views import password_reset, password_reset_confirm,\ # app_name = 'yaksh' urlpatterns = [ - url(r'^forgotpassword/$', password_reset, name="password_reset"), + url(r'^forgotpassword/$', password_reset, + {'template_name': 'register/password_reset_form.html'}, + name="password_reset"), url(r'^password_reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', - password_reset_confirm, name='password_reset_confirm'), + password_reset_confirm, + {'template_name': 'register/password_reset_confirm.html'}, + name='password_reset_confirm'), url(r'^password_reset/mail_sent/$', password_reset_done, + {'template_name': 'register/password_reset_done.html'}, name='password_reset_done'), url(r'^password_reset/complete/$', password_reset_complete, + {'template_name': 'register/password_reset_complete.html'}, name='password_reset_complete'), url(r'^changepassword/$', password_change, + {'template_name': 'register/password_change_form.html'}, name='password_change'), url(r'^password_change/done/$', password_change_done, + {'template_name': 'register/password_change_done.html'}, name='password_change_done'), ] + urlpatterns += [ url(r'^$', views.index), url(r'^login/$', views.user_login, name='login'), |