1. Andrew Mirsky
  2. django-registration

Commits

ubernostrum  committed 830c963

Tweak activation URL to only match on a valid hash

  • Participants
  • Parent commits 6f50457
  • Branches default

Comments (0)

Files changed (2)

File urls.py

View file
 from views import activate, register
 
 urlpatterns = patterns('',
-                       (r'^activate/(?P<activation_key>\w+)/$', activate),
+                       (r'^activate/(?P<activation_key>[a-fA-f0-9]+)/$', activate),
                        (r'^login/$', login, {'template_name': 'registration/login.html'}),
                        (r'^logout/$', logout, {'template_name': 'registration/logout.html'}),
                        (r'^register/$', register),

File views.py

View file
         registration/activate.html
     
     """
+    activation_key = activation_key.lower()
     account = RegistrationProfile.objects.activate_user(activation_key)
     return render_to_response('registration/activate.html',
                               {'account': account,