Commits

Frank Becker committed ea725b6

just temp redirects, still not a solution

Comments (0)

Files changed (2)

src/pentasubmitter/urls.py

 from django.conf.urls.defaults import patterns, include
 from django.conf import settings
-from django.views.generic.simple import redirect_to, direct_to_template
+from django.views.generic.simple import direct_to_template
 from django.conf.urls.defaults import *
+from django.views.generic import RedirectView
 from haystack.views import SearchView
 from haystack.query import SearchQuerySet
 
 
 urlpatterns = patterns(
     '',
-    ('^$', redirect_to, {'url': '/submit/'}),
+    #('^$', redirect_to, {'url': '/submit/'}),
+    ('^$', RedirectView.as_view(url='/submit/')),
 )
 
 urlpatterns += patterns(
 urlpatterns += patterns(
     '',
     (r'^account/user.html$', 'pentasubmitter.views.user_account_management'),
-    ('^account/$', redirect_to, {'url': '/'}),
+    ('^account/$', RedirectView.as_view(url='/')),
     (r'^account/', include('django_authopenid.urls')),
     (r'^avatar/', include('avatar.urls')),
     (r'^comments/', include('django.contrib.comments.urls')),

src/submitter/urls.py

 
 from django.conf.urls.defaults import patterns, url
 from django.http import Http404
-from django.views.generic.simple import redirect_to, direct_to_template
+from django.views.generic import RedirectView
 from django.utils.translation import ugettext_lazy as _
 #from django.views.generic.simple import direct_to_template
 from submitter.views import news_per_category, news_per_show, \
 from submitter.views import get_next_shows
 
 # get next show for redirect
-next_shows = get_next_shows()
-if not next_shows:
-    raise Http404
-penta_show_slug = next_shows[0].slug
+def next_show_slug():
+    next_shows = get_next_shows()
+    if not next_shows:
+        raise Http404
+    return next_shows[0].slug
 
 urlpatterns = patterns(
     '',
     #('^$', redirect_to, {'url': 'last/'}),
-    ('^$', redirect_to, {'url': 'news-per-show/' + penta_show_slug}),
+    ('^$', RedirectView.as_view(url='news-per-show/' + next_show_slug(),
+                                permanent=False)),
 )
 
 news_entry_info_dict = dict(