Pull requests

#63 Declined
Repository
kubazarz kubazarz
Branch
django1.6
Repository
ubernostrum ubernostrum
Branch
default

Django 1.6 compatibility fix. Auth views' redirects are explicitly specified now.

Author
  1. kubazarz
Reviewers
Description

In Django 1.6 auth views are reversed by name, not by path, so I explicitly specified redirects where it's needed.

Comments (22)

  1. Daniel Wiesmann

    An alternative to this fix could be to simply use the Url names that Django uses in the django.contrib.auth.views module. This would be the same names as used here, but without the auth_ prefix. Not sure if there is a specific reason for using different names here.

  2. Erik Wickstrom

    One more fix is needed. In Django 1.6, auth_views.password_reset_confirm expects the url parameter passed in to be named uidb64, not uidb36.

    Django 1.6 has a version of the old view (password_reset_confirm_uidb36) for backwards compatibility -- but it is going to be removed in Django 1.7.

  3. Dominik Kozaczko

    I still get

    NoReverseMatch at /account/password/reset/
    Reverse for 'password_reset_confirm' with arguments '()' and keyword arguments '{u'uidb64': 'Mzc', u'token': u'3o7-e5311af4f05e635752b7'}' not found. 0 pattern(s) tried: []
    

    Looks like the template in django.contrib.auth requires this view name:

    Error during template rendering
    
    In template /home/minder/projekty/priv/strefa-env/lib/python2.7/site-packages/django/contrib/admin/templates/registration/password_reset_email.html, error at line 6
    Reverse for 'password_reset_confirm' with arguments '()' and keyword arguments '{u'uidb64': 'Mzc', u'token': u'3o7-e5311af4f05e635752b7'}' not found. 0 pattern(s) tried: []
    1   {% load i18n %}{% autoescape off %}
    2   {% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
    3   
    4   {% trans "Please go to the following page and choose a new password:" %}
    5   {% block reset_link %}
    6   {{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
    7   {% endblock %}
    8   {% trans "Your username, in case you've forgotten:" %} {{ user.get_username }}
    9   
    10  {% trans "Thanks for using our site!" %}
    11  
    12  {% blocktrans %}The {{ site_name }} team{% endblocktrans %}
    13  
    14  {% endautoescape %}
    15  
    

    Please update docs to suggest providing your own template.

  4. Ragi Burhum

    Does this mean this pull request is not complete? I would love to be able to upgrade to Django 1.6, but django-registration is my only show stopper right now...

  5. mrts

    As of Django 1.6, there is a bundled contrib.auth.urls.py, quoting the comment:

    # The views used below are normally mapped in django.contrib.admin.urls.py
    ...
    # It is also provided as a convenience to those who want to deploy these URLs
    # elsewhere.
    

    So, just

        (r'', include('django.contrib.auth.urls')),
    

    instead of

        (r'', include('registration.auth_urls')),
    

    Or am I missing something? What use cases are not covered by contrib.auth.urls.py?

  6. Sayed Raianul Kabir

    File "/Users/newscred/projects/python/dhms/src/django-registration/registration/models.py", line 10, in <module> from django.utils.hashcompat import sha_constructor

    I am getting this, what should I do ?