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 <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2016-06-08 09:55:30 +12:00
parent 5e6a50c07d
commit 4d6894ccbb
3 changed files with 8 additions and 8 deletions

View File

@ -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<slug>[-\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(

View File

@ -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'),

View File

@ -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)),
)