FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Updating the username regex in relationships and profile so names wit… · cloudinskywith/django-basic-apps@fe314eb · GitHub

Repository navigation

Commit fe314eb

Browse files
committed
Updating the username regex in relationships and profile so names with a '.' in them work.
1 parent 3942e8b commit fe314eb

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

‎basic/profiles/urls.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from django.conf.urls.defaults import *
22

33

4+
USERNAME = r'(?P<username>[-.\w]+)'
5+
46
urlpatterns = patterns('basic.profiles.views',
57
url(r'^edit/$',
68
view='profile_edit',
79
name='profile_edit',
810
),
9-
url(r'^(?P<username>[-\w]+)/$',
11+
url(r'^%s/$' % USERNAME,
1012
view='profile_detail',
1113
name='profile_detail',
1214
),

‎basic/relationships/urls.py‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
from django.conf.urls.defaults import *
22

33

4+
USERNAME = r'(?P<username>[-.\w]+)'
5+
46
urlpatterns = patterns('basic.relationships.views',
5-
url(r'^following/(?P<username>\w+)/$',
7+
url(r'^following/%s/$' % USERNAME,
68
view='following',
79
name='relationship_following'
810
),
9-
url(r'^followers/(?P<username>\w+)/$',
11+
url(r'^followers/%s/$' % USERNAME,
1012
view='followers',
1113
name='relationship_followers'
1214
),
13-
url(r'^follow/(?P<username>\w+)/$',
15+
url(r'^follow/%s/$' % USERNAME,
1416
view='follow',
1517
name='relationship_follow'
1618
),
17-
url(r'^unfollow/(?P<username>\w+)/$',
19+
url(r'^unfollow/%s/$' % USERNAME,
1820
view='unfollow',
1921
name='relationship_unfollow'
2022
),
21-
url(r'^block/(?P<username>\w+)/$',
23+
url(r'^block/%s/$' % USERNAME,
2224
view='block',
2325
name='relationship_block'
2426
),
25-
url(r'^unblock/(?P<username>\w+)/$',
27+
url(r'^unblock/%s/$' % USERNAME,
2628
view='unblock',
2729
name='relationship_unblock'
2830
),
29-
)
31+
)

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL