X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/04aadd147b0d494c043caf9702684592652a26ab..fff6f83f3de32fa25f6e9f611cc912706a092c5d:/forum/urls.py diff --git a/forum/urls.py b/forum/urls.py index 3d202c7..22b8fab 100644 --- a/forum/urls.py +++ b/forum/urls.py @@ -2,7 +2,7 @@ import startup import os.path from forum import settings -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url, include from django.conf import settings as djsettings from django.contrib import admin from forum import views as app @@ -18,11 +18,6 @@ sitemaps = { APP_PATH = os.path.dirname(__file__) -try: - admin_url = url(r'^%s(.*)' % _('nimda/'), admin.site.root) -except AttributeError: - admin_url = url(r'^%s(.*)' % _('nimda/'), admin.site.urls) - # Choose the user urls pattern if bool(settings.INCLUDE_ID_IN_USER_URLS.value): core_user_urls_prefix = r'^%s(?P\d+)/(?P.*)' @@ -30,7 +25,8 @@ else: core_user_urls_prefix = r'^%s(?P.*)' core_urls = ( - url(r'^$', app.readers.index, name='index'), admin_url, + url(r'^$', app.readers.index, name='index'), + url(r'^%s(.*)' % _('nimda/'), admin.site.urls), url(r'^sitemap.xml$', 'forum.sitemap.index', {'sitemaps': sitemaps}), url(r'^sitemap-(?P
.+)-(?P\d+)\.xml$', 'forum.sitemap.sitemap', {'sitemaps': sitemaps}, name="sitemap_section_page"), @@ -85,7 +81,7 @@ core_urls = ( url(r'^%s(?P\d+)/' % _('convert_to_question/'), app.writers.convert_to_question,name='convert_to_question'), url(r'^%s(?P\d+)/' % _('wikify/'), app.commands.wikify, name='wikify'), - url(r'^%s(?P\d+)/(?P[\w-]*)$' % _('question/'), 'django.views.generic.simple.redirect_to', {'url': '/questions/%(id)s/%(slug)s'}), + url(r'^%s(?P\d+)/(?P[\w-]*)$' % _('question/'), 'django.shortcuts.redirect', {'url': '/questions/%(id)s/%(slug)s'}), url(r'^%s(?P\d+)/?$' % _('questions/'), app.readers.question, name='question'), url(r'^%s(?P\d+)/(?P.*)/(?P\d+)$' % _('questions/'), app.readers.question), url(r'^%s(?P\d+)/(?P.*)$' % _('questions/'), app.readers.question, name='question'), @@ -100,9 +96,10 @@ core_urls = ( url(r'^%s$' % _('users/'), app.users.users, name='users'), # url(r'^%s$' % _('online_users/'), app.users.online_users, name='online_users'), - url(r'^%s(?P\d+)/%s$' % (_('users/'), _('edit/')), app.users.edit_user, name='edit_user'), + url(r'^%s(?P\d+)/(?P.*)/%s$' % (_('users/'), _('edit/')), app.users.edit_user, name='edit_user'), url(r'^%s(?P\d+)/%s$' % (_('users/'), _('award/')), app.users.award_points, name='user_award_points'), url(r'^%s(?P\d+)/%s$' % (_('users/'), _('suspend/')), app.users.suspend, name='user_suspend'), + url(r'^%s(?P\d+)/%s$' % (_('users/'), _('report/')), app.users.report_user, name='user_report'), url(r'^%s(?P\d+)/%s(?P[a-z]+)/(?P[a-z]+)/$' % (_('users/'), _('powers/')), app.users.user_powers, name='user_powers'), url((core_user_urls_prefix + '/%s$') % (_('users/'), _('subscriptions/')), app.users.user_subscriptions, name='user_subscriptions'), url(r'^%s(?P\d+)/(?P.*)/%s$' % (_('users/'), _('preferences/')), app.users.user_preferences, name='user_preferences'),