]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/urls.py
Prevents questions on which the slug comes out empty to enter a redirect loop.
[osqa.git] / forum / urls.py
index 5f3fbc5ebe857c460e30b999676990b80d33ddd7..faea61a466ede699cfea1e42e657cfa2d577841b 100644 (file)
@@ -94,8 +94,8 @@ urlpatterns += patterns('',
                         url(r'^%s(?P<id>\d+)/(?P<slug>[\w-]*)$' % _('question/'),
                             'django.views.generic.simple.redirect_to', {'url': '/questions/%(id)s/%(slug)s'}),
                         url(r'^%s(?P<id>\d+)/?$' % _('questions/'), app.readers.question, name='question'),
-                        url(r'^%s(?P<id>\d+)/(?P<slug>[\w-]*)$' % _('questions/'), app.readers.question, name='question'),
-                        url(r'^%s(?P<id>\d+)/(?P<slug>[\w-]*)/(?P<answer>\d+)$' % _('questions/'), app.readers.question),
+                        url(r'^%s(?P<id>\d+)/(?P<slug>.*)$' % _('questions/'), app.readers.question, name='question'),
+                        url(r'^%s(?P<id>\d+)/(?P<slug>.*)/(?P<answer>\d+)$' % _('questions/'), app.readers.question),
 
 
                         url(r'^%s$' % _('tags/'), app.readers.tags, name='tags'),
@@ -124,6 +124,8 @@ urlpatterns += patterns('',
                             app.users.user_powers, name='user_powers'),
                         url(r'^%s(?P<id>\d+)/(?P<slug>.+)/%s$' % (_('users/'), _('subscriptions/')), app.users.user_subscriptions,
                             name='user_subscriptions'),
+                        url(r'^%s(?P<id>\d+)/(?P<slug>.+)/%s$' % (_('users/'), _('preferences/')), app.users.user_preferences,
+                            name='user_preferences'),
                         url(r'^%s(?P<id>\d+)/(?P<slug>.+)/%s$' % (_('users/'), _('favorites/')),
                             app.users.user_favorites, name='user_favorites'),
                         url(r'^%s(?P<id>\d+)/(?P<slug>.+)/%s$' % (_('users/'), _('reputation/')),