From 4d6894ccbbd388529c3d0dee1580f09f8e4a7426 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Wed, 8 Jun 2016 09:55:30 +1200 Subject: [PATCH] Explicitly specify temporary redirection Django 1.8 warns that the default for the "permanent" parameter to RedirectView is changing in 1.9 from True to False, but I believe we should be specifying False for these redirections - these are not just redirections from old URLs and may in fact change in the future if the site structure changes. Part of the implementation for [YOCTO #9620]. Signed-off-by: Paul Eggleton --- layerindex/urls.py | 12 ++++++------ layerindex/urls_branch.py | 2 +- urls.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/layerindex/urls.py b/layerindex/urls.py index b170460..cbd29ad 100644 --- a/layerindex/urls.py +++ b/layerindex/urls.py @@ -24,19 +24,19 @@ router.register(r'machines', restviews.MachineViewSet) urlpatterns = patterns('', url(r'^$', - RedirectView.as_view(url=reverse_lazy('layer_list', args=('master',))), + RedirectView.as_view(url=reverse_lazy('layer_list', args=('master',)), permanent=False), name='frontpage'), url(r'^api/', include(router.urls)), url(r'^layers/$', - RedirectView.as_view(url=reverse_lazy('layer_list', args=('master',)))), + RedirectView.as_view(url=reverse_lazy('layer_list', args=('master',)), permanent=False)), url(r'^layer/(?P[-\w]+)/$', - RedirectParamsView.as_view(), {'redirect_name': 'layer_item', 'branch':'master'}), + RedirectParamsView.as_view(permanent=False), {'redirect_name': 'layer_item', 'branch':'master'}), url(r'^recipes/$', - RedirectView.as_view(url=reverse_lazy('recipe_search', args=('master',)))), + RedirectView.as_view(url=reverse_lazy('recipe_search', args=('master',)), permanent=False)), url(r'^machines/$', - RedirectView.as_view(url=reverse_lazy('machine_search', args=('master',)))), + RedirectView.as_view(url=reverse_lazy('machine_search', args=('master',)), permanent=False)), url(r'^submit/$', edit_layer_view, {'template_name': 'layerindex/submitlayer.html'}, name="submit_layer"), url(r'^submit/thanks$', @@ -107,7 +107,7 @@ urlpatterns = patterns('', template_name='layerindex/about.html'), name="about"), url(r'^oe-classic/$', - RedirectView.as_view(url=reverse_lazy('classic_recipe_search')), + RedirectView.as_view(url=reverse_lazy('classic_recipe_search'), permanent=False), name='classic'), url(r'^oe-classic/recipes/$', ClassicRecipeSearchView.as_view( diff --git a/layerindex/urls_branch.py b/layerindex/urls_branch.py index ab5e2d5..3313290 100644 --- a/layerindex/urls_branch.py +++ b/layerindex/urls_branch.py @@ -11,7 +11,7 @@ from layerindex.views import LayerListView, RecipeSearchView, MachineSearchView, urlpatterns = patterns('', url(r'^$', - RedirectParamsView.as_view(), {'redirect_name': 'layer_list'}), + RedirectParamsView.as_view(permanent=False), {'redirect_name': 'layer_list'}), url(r'^layers/$', LayerListView.as_view( template_name='layerindex/layers.html'), diff --git a/urls.py b/urls.py index 98fc734..649635c 100644 --- a/urls.py +++ b/urls.py @@ -16,6 +16,6 @@ urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^accounts/', include('registration.backends.default.urls')), url(r'^captcha/', include('captcha.urls')), - url(r'.*', RedirectView.as_view(url='/layerindex/')), + url(r'.*', RedirectView.as_view(url='/layerindex/', permanent=False)), )