summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprathamesh2017-02-01 13:00:34 +0530
committerprathamesh2017-02-01 13:00:34 +0530
commit8427da2f08ae590b427027abe36351018c685f8e (patch)
treef6cf886524d6715f35d27a6221934769eb95f3e8
parenta64b9c30f2cd4554734bba16b0aad7647475000d (diff)
downloadonline_test-8427da2f08ae590b427027abe36351018c685f8e.tar.gz
online_test-8427da2f08ae590b427027abe36351018c685f8e.tar.bz2
online_test-8427da2f08ae590b427027abe36351018c685f8e.zip
Forgot Password and Reset Issue Resolved
The problem was: We have included yaksh urls to the project urls with the namespace "yaksh". So whenever we call the url name i.e "yaksh:<url>" a reverse match is made. But for Forgot Password and Change Password we are using django's in-built functionality, where the reverse url is hardcoded. So the reverse match fails as the namespace is not specified! To resolve this, created a urls_password_reset URL dispatcher file and included to the project urls.
-rw-r--r--online_test/urls.py1
-rw-r--r--yaksh/templates/registration/password_change_done.html (renamed from yaksh/templates/register/password_change_done.html)0
-rw-r--r--yaksh/templates/registration/password_change_form.html (renamed from yaksh/templates/register/password_change_form.html)0
-rw-r--r--yaksh/templates/registration/password_reset_complete.html (renamed from yaksh/templates/register/password_reset_complete.html)0
-rw-r--r--yaksh/templates/registration/password_reset_confirm.html (renamed from yaksh/templates/register/password_reset_confirm.html)0
-rw-r--r--yaksh/templates/registration/password_reset_done.html (renamed from yaksh/templates/register/password_reset_done.html)0
-rw-r--r--yaksh/templates/registration/password_reset_form.html (renamed from yaksh/templates/register/password_reset_form.html)0
-rw-r--r--yaksh/templates/user.html2
-rw-r--r--yaksh/templates/yaksh/login.html2
-rw-r--r--yaksh/urls.py26
-rw-r--r--yaksh/urls_password_reset.py20
11 files changed, 23 insertions, 28 deletions
diff --git a/online_test/urls.py b/online_test/urls.py
index 8e733b9..ce0de41 100644
--- a/online_test/urls.py
+++ b/online_test/urls.py
@@ -11,6 +11,7 @@ urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^exam/', include('yaksh.urls', namespace='yaksh', app_name='yaksh')),
+ url(r'^exam/reset/', include('yaksh.urls_password_reset')),
url(r'^', include('social.apps.django_app.urls', namespace='social')),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
diff --git a/yaksh/templates/register/password_change_done.html b/yaksh/templates/registration/password_change_done.html
index 14df20c..14df20c 100644
--- a/yaksh/templates/register/password_change_done.html
+++ b/yaksh/templates/registration/password_change_done.html
diff --git a/yaksh/templates/register/password_change_form.html b/yaksh/templates/registration/password_change_form.html
index b618410..b618410 100644
--- a/yaksh/templates/register/password_change_form.html
+++ b/yaksh/templates/registration/password_change_form.html
diff --git a/yaksh/templates/register/password_reset_complete.html b/yaksh/templates/registration/password_reset_complete.html
index 0c1bae2..0c1bae2 100644
--- a/yaksh/templates/register/password_reset_complete.html
+++ b/yaksh/templates/registration/password_reset_complete.html
diff --git a/yaksh/templates/register/password_reset_confirm.html b/yaksh/templates/registration/password_reset_confirm.html
index 1b0a1b7..1b0a1b7 100644
--- a/yaksh/templates/register/password_reset_confirm.html
+++ b/yaksh/templates/registration/password_reset_confirm.html
diff --git a/yaksh/templates/register/password_reset_done.html b/yaksh/templates/registration/password_reset_done.html
index 1ac7b60..1ac7b60 100644
--- a/yaksh/templates/register/password_reset_done.html
+++ b/yaksh/templates/registration/password_reset_done.html
diff --git a/yaksh/templates/register/password_reset_form.html b/yaksh/templates/registration/password_reset_form.html
index 0444584..0444584 100644
--- a/yaksh/templates/register/password_reset_form.html
+++ b/yaksh/templates/registration/password_reset_form.html
diff --git a/yaksh/templates/user.html b/yaksh/templates/user.html
index 6f2137d..6f879fe 100644
--- a/yaksh/templates/user.html
+++ b/yaksh/templates/user.html
@@ -29,7 +29,7 @@
<li><a href="{{ URL_ROOT }}/exam/quizzes"> Home </a></li>
<li><a href="{{ URL_ROOT }}/exam/quizzes/enrolled/"> Enrolled Courses </a></li>
<li><a href="{{ URL_ROOT }}/exam/viewprofile"> Profile </a></li>
- <li><a href="{{ URL_ROOT }}/exam/changepassword"> Change Password </a></li>
+ <li><a href="{{ URL_ROOT }}/exam/reset/changepassword"> Change Password </a></li>
</ul>
</div>
<div class="col-sm-8 col-sm-offset-3 col-md-9 col-md-offset-2 main">
diff --git a/yaksh/templates/yaksh/login.html b/yaksh/templates/yaksh/login.html
index 0a6fdc1..e4b5933 100644
--- a/yaksh/templates/yaksh/login.html
+++ b/yaksh/templates/yaksh/login.html
@@ -12,7 +12,7 @@
{{ form.as_table }}
</table></center>
<button class="btn btn-primary" type="submit">Login</button>
- <a class="btn btn-primary" href="{{URL_ROOT}}/exam/forgotpassword/">Forgot Password?</a>
+ <a class="btn btn-primary" href="{{URL_ROOT}}/exam/reset/forgotpassword/">Forgot Password?</a>
<a class="btn btn-primary" href="{{URL_ROOT}}/exam/register/">New User? Sign-Up </a>
<h3> Login with </h3>
<a class="btn btn-social-icon btn-google" href="{% url 'social:begin' 'google-oauth2' %}">
diff --git a/yaksh/urls.py b/yaksh/urls.py
index 629f8f5..5544088 100644
--- a/yaksh/urls.py
+++ b/yaksh/urls.py
@@ -1,33 +1,7 @@
from django.conf.urls import patterns, url
from yaksh import views
-from django.contrib.auth.views import password_reset, password_reset_confirm,\
- password_reset_done, password_reset_complete, password_change,\
- password_change_done
-# app_name = 'yaksh'
urlpatterns = [
- 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,
- {'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'),
url(r'^quizzes/$', views.quizlist_user, name='quizlist_user'),
diff --git a/yaksh/urls_password_reset.py b/yaksh/urls_password_reset.py
new file mode 100644
index 0000000..c1e36c6
--- /dev/null
+++ b/yaksh/urls_password_reset.py
@@ -0,0 +1,20 @@
+from django.conf.urls import patterns, url
+from django.contrib.auth.views import password_reset, password_reset_confirm,\
+ password_reset_done, password_reset_complete, password_change,\
+ password_change_done
+
+urlpatterns = [
+ url(r'^forgotpassword/$', password_reset,
+ name="password_reset"),
+ url(r'^password_reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
+ password_reset_confirm,
+ name='password_reset_confirm'),
+ url(r'^password_reset/mail_sent/$', password_reset_done,
+ name='password_reset_done'),
+ url(r'^password_reset/complete/$', password_reset_complete,
+ name='password_reset_complete'),
+ url(r'^changepassword/$', password_change,
+ name='password_change'),
+ url(r'^password_change/done/$', password_change_done,
+ name='password_change_done'),
+]