diff options
author | Dan McGee <dan@archlinux.org> | 2012-07-24 19:56:22 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-07-24 19:57:20 -0500 |
commit | d68e00f19556be169f303da256c79431e15dd448 (patch) | |
tree | ce49e8e5b582d28d8c15f43301e7a0ed3ff74193 | |
parent | 590060d1b4f7e82a0c637a5e8dc5d348431651af (diff) |
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.py | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -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: |