Commits

Tino de Bruijn committed 56abc68

Fixed urls, and added 'forgot password'-link to login form

Comments (0)

Files changed (2)

email_login/templates/email_login/login.html

     <label for="id_password" class="required">{% trans 'Password:' %}</label> {{ form.password }}
     <input type="hidden" name="this_is_the_login_form" value="1" />
     <input type="hidden" name="next" value="{{ next }}" />
+    <input type="hidden" name="post_data" value="{{ post_data }}" /> <span class="help"><a href="{% url django.contrib.auth.views.password_reset %}">{% trans 'I forgot my password' %}</a></span>
   </div>
   <div class="submit-row">
     <label>&nbsp;</label><input type="submit" value="{% trans 'Log in' %}" />

email_login/urls.py

 # We need to override login view, the rest is ok.
 from django.conf.urls.defaults import *
-from django.contrib.auth.urls import urlpatterns
+from django.contrib.auth.urls import urlpatterns as auth_urls
+from forms import EmailAuthenticationForm
 
-urlpatterns += patterns('',
+urlpatterns = patterns('',
     (r'^login/$', 'django.contrib.auth.views.login', 
         { 'template_name' : 'email_login/login.html',
-          'authentication_form' : 'email_login.forms.EmailAuthenticationForm'}),
-)
+          'authentication_form' : EmailAuthenticationForm}),
+)
+
+urlpatterns += auth_urls