From d68e00f19556be169f303da256c79431e15dd448 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 24 Jul 2012 19:56:22 -0500 Subject: Remove use of deprecated redirect_to function-based generic view We can use the class-based replacement instead. Signed-off-by: Dan McGee --- urls.py | 12 ++++-------- 1 file 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: -- cgit v1.2.3-24-g4f1b