Permalink
Browse files

Updating the username regex in relationships and profile so names wit…

…h a '.' in them work.
  • Loading branch information...
1 parent 3942e8b commit fe314eb843b74f2f3a8cd40dd988a97939be21e8 @nathanborror committed Nov 23, 2012
Showing with 12 additions and 8 deletions.
  1. +3 −1 basic/profiles/urls.py
  2. +9 −7 basic/relationships/urls.py
@@ -1,12 +1,14 @@
from django.conf.urls.defaults import *
+USERNAME = r'(?P<username>[-.\w]+)'
+
urlpatterns = patterns('basic.profiles.views',
url(r'^edit/$',
view='profile_edit',
name='profile_edit',
),
- url(r'^(?P<username>[-\w]+)/$',
+ url(r'^%s/$' % USERNAME,
view='profile_detail',
name='profile_detail',
),
@@ -1,29 +1,31 @@
from django.conf.urls.defaults import *
+USERNAME = r'(?P<username>[-.\w]+)'
+
urlpatterns = patterns('basic.relationships.views',
- url(r'^following/(?P<username>\w+)/$',
+ url(r'^following/%s/$' % USERNAME,
view='following',
name='relationship_following'
),
- url(r'^followers/(?P<username>\w+)/$',
+ url(r'^followers/%s/$' % USERNAME,
view='followers',
name='relationship_followers'
),
- url(r'^follow/(?P<username>\w+)/$',
+ url(r'^follow/%s/$' % USERNAME,
view='follow',
name='relationship_follow'
),
- url(r'^unfollow/(?P<username>\w+)/$',
+ url(r'^unfollow/%s/$' % USERNAME,
view='unfollow',
name='relationship_unfollow'
),
- url(r'^block/(?P<username>\w+)/$',
+ url(r'^block/%s/$' % USERNAME,
view='block',
name='relationship_block'
),
- url(r'^unblock/(?P<username>\w+)/$',
+ url(r'^unblock/%s/$' % USERNAME,
view='unblock',
name='relationship_unblock'
),
-)
+)

0 comments on commit fe314eb

Please sign in to comment.