summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-07-25 02:56:22 +0200
committerDan McGee <dan@archlinux.org>2012-07-25 02:57:20 +0200
commitd68e00f19556be169f303da256c79431e15dd448 (patch)
treece49e8e5b582d28d8c15f43301e7a0ed3ff74193
parent590060d1b4f7e82a0c637a5e8dc5d348431651af (diff)
downloadarchweb-d68e00f19556be169f303da256c79431e15dd448.tar.gz
archweb-d68e00f19556be169f303da256c79431e15dd448.tar.xz
Remove use of deprecated redirect_to function-based generic view
We can use the class-based replacement instead. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--urls.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/urls.py b/urls.py
index 65f436d..d777b86 100644
--- a/urls.py
+++ b/urls.py
@@ -1,11 +1,8 @@
-import os.path
-
-from django.conf.urls import include, patterns
-from django.conf import settings
+from django.conf.urls import include, patterns, url
from django.contrib import admin
-from django.views.generic import TemplateView
from django.views.decorators.cache import cache_page
+from django.views.generic import TemplateView, RedirectView
from django.views.i18n import null_javascript_catalog
from feeds import PackageFeed, NewsFeed
@@ -105,8 +102,7 @@ legacy_urls = (
('^packages.php', '/packages/'),
)
-for old_url, new_url in legacy_urls:
- urlpatterns += patterns('django.views.generic.simple',
- (old_url, 'redirect_to', {'url': new_url}))
+urlpatterns += [url(old_url, RedirectView.as_view(url=new_url))
+ for old_url, new_url in legacy_urls]
# vim: set ts=4 sw=4 et: