changeset 289:0dd8989abef2

Fix regexes for usernames in various urls.py files to match valid Django usernames
author Brian Neal <bgneal@gmail.com>
date Thu, 23 Dec 2010 23:36:53 +0000
parents 4ba879ccdc62
children 64c188a9d31f
files gpp/accounts/urls.py gpp/bio/urls.py gpp/forums/urls.py gpp/messages/urls.py
diffstat 4 files changed, 11 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/gpp/accounts/urls.py	Sun Dec 05 20:58:58 2010 +0000
+++ b/gpp/accounts/urls.py	Thu Dec 23 23:36:53 2010 +0000
@@ -5,7 +5,7 @@
 urlpatterns = patterns('accounts.views',
     url(r'^register/$', 'register', name='accounts-register'),
     (r'^register/thanks/$', 'register_thanks'),
-    (r'^register/confirm/(?P<username>\w{1,30})/(?P<key>[a-zA-Z0-9]{20})/$', 'register_confirm'),
+    (r'^register/confirm/(?P<username>[\w.@+-]{1,30})/(?P<key>[a-zA-Z0-9]{20})/$', 'register_confirm'),
 )
 
 urlpatterns += patterns('',
@@ -16,13 +16,13 @@
     url(r'^logout/$',
         'django.contrib.auth.views.logout',
         kwargs={'template_name': 'accounts/logout.html'},
-        name='accounts-logout'), 
-    (r'^password/$', 
-        'django.contrib.auth.views.password_change', 
+        name='accounts-logout'),
+    (r'^password/$',
+        'django.contrib.auth.views.password_change',
         {'template_name': 'accounts/password_change.html',
          'post_change_redirect': settings.LOGIN_REDIRECT_URL}),
-    url(r'^password/reset/$', 
-        'django.contrib.auth.views.password_reset', 
+    url(r'^password/reset/$',
+        'django.contrib.auth.views.password_reset',
         kwargs={'template_name': 'accounts/password_reset.html',
          'email_template_name': 'accounts/password_reset_email.txt',
          'post_reset_redirect': '/accounts/password/reset/sent/'},
--- a/gpp/bio/urls.py	Sun Dec 05 20:58:58 2010 +0000
+++ b/gpp/bio/urls.py	Thu Dec 23 23:36:53 2010 +0000
@@ -2,12 +2,12 @@
 from django.conf.urls.defaults import *
 
 urlpatterns = patterns('bio.views',
-    url(r'^members/(?P<type>user|date)/$', 
-        'member_list', 
+    url(r'^members/(?P<type>user|date)/$',
+        'member_list',
         name='bio-member_list'),
     url(r'^members/search/$', 'member_search', name='bio-member_search'),
     url(r'^me/$', 'my_profile', name='bio-me'),
-    url(r'^view/(?P<username>\w{1,30})/$', 'view_profile', name='bio-view_profile'),
+    url(r'^view/(?P<username>[\w.@+-]{1,30})/$', 'view_profile', name='bio-view_profile'),
     url(r'^edit/$', 'edit_profile', name='bio-edit_profile'),
     url(r'^edit/elsewhere/$', 'edit_elsewhere', name='bio-edit_elsewhere'),
     url(r'^avatar/$', 'change_avatar', name='bio-change_avatar'),
--- a/gpp/forums/urls.py	Sun Dec 05 20:58:58 2010 +0000
+++ b/gpp/forums/urls.py	Thu Dec 23 23:36:53 2010 +0000
@@ -23,7 +23,7 @@
     url(r'^post/(\d+)/$', 'goto_post', name='forums-goto_post'),
     url(r'^post/ip/(\d+)/$', 'post_ip_info', name='forums-post_ip_info'),
     url(r'^post/new/(?P<topic_id>\d+)/$', 'new_post', name='forums-new_post'),
-    url(r'^posts/(?P<username>[\w\d-]+)/$', 'posts_for_user', name='forums-posts_for_user'),
+    url(r'^posts/(?P<username>[\w.@+-]{1,30})/$', 'posts_for_user', name='forums-posts_for_user'),
     url(r'^quick-reply/$', 'quick_reply_ajax', name='forums-quick_reply'),
     url(r'^unanswered/$', 'unanswered_topics', name='forums-unanswered_topics'),
     url(r'^unread/$', 'unread_topics', name='forums-unread_topics'),
--- a/gpp/messages/urls.py	Sun Dec 05 20:58:58 2010 +0000
+++ b/gpp/messages/urls.py	Thu Dec 23 23:36:53 2010 +0000
@@ -8,7 +8,7 @@
     url(r'^view/(\d+)/$', 'view', name='messages-view'),
     url(r'^reply/(\d+)/$', 'reply', name='messages-reply'),
     url(r'^compose/$', 'compose', name='messages-compose'),
-    url(r'^compose/(\w+)/$', 'compose', name='messages-compose_to'),
+    url(r'^compose/([\w.@+-]{1,30})/$', 'compose', name='messages-compose_to'),
     url(r'^delete/$', 'delete_bulk', name='messages-delete_bulk'),
     url(r'^delete/(\d+)/$', 'delete', name='messages-delete'),
     url(r'^undelete/$', 'undelete_bulk', name='messages-undelete_bulk'),
@@ -20,5 +20,3 @@
     (r'^$', 'redirect_to', {'url': 'inbox/'}),
 )
 
-
-# vim: ts=4 sw=4