[bitbake-devel] [PATCH 08/18] toaster: Prevent deprecation warnings for RedirectView

brian avery avery.brian at gmail.com
Thu Dec 10 03:56:33 UTC 2015


From: Elliot Smith <elliot.smith at intel.com>

The API for RedirectView is due to change in Django 1.9, which
means that Toaster generates deprecation warnings.

Set the "permanent" flag when constructing RedirectView instances
to prevent this warning.

[YOCTO #8364]

Signed-off-by: Elliot Smith <elliot.smith at intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
Signed-off-by: brian avery <avery.brian at gmail.com>
---
 lib/toaster/bldcollector/urls.py | 1 -
 lib/toaster/toastergui/urls.py   | 2 +-
 lib/toaster/toastermain/urls.py  | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/toaster/bldcollector/urls.py b/lib/toaster/bldcollector/urls.py
index 144387b..64722f2 100644
--- a/lib/toaster/bldcollector/urls.py
+++ b/lib/toaster/bldcollector/urls.py
@@ -18,7 +18,6 @@
 
 
 from django.conf.urls import patterns, include, url
-from django.views.generic import RedirectView
 
 urlpatterns = patterns('bldcollector.views',
         # landing point for pushing a bitbake_eventlog.json file to this toaster instace
diff --git a/lib/toaster/toastergui/urls.py b/lib/toaster/toastergui/urls.py
index a1adbb7..2bf2d99 100644
--- a/lib/toaster/toastergui/urls.py
+++ b/lib/toaster/toastergui/urls.py
@@ -168,5 +168,5 @@ urlpatterns = patterns('toastergui.views',
             name='xhr_customrecipe'),
 
           # default redirection
-        url(r'^$', RedirectView.as_view( url= 'landing')),
+        url(r'^$', RedirectView.as_view(url='landing', permanent=True)),
 )
diff --git a/lib/toaster/toastermain/urls.py b/lib/toaster/toastermain/urls.py
index 5ce5a92..534679d 100644
--- a/lib/toaster/toastermain/urls.py
+++ b/lib/toaster/toastermain/urls.py
@@ -45,7 +45,7 @@ urlpatterns = patterns('',
     url(r'^orm/eventfile$', 'bldcollector.views.eventfile'),
 
     # if no application is selected, we have the magic toastergui app here
-    url(r'^$', never_cache(RedirectView.as_view(url='/toastergui/'))),
+    url(r'^$', never_cache(RedirectView.as_view(url='/toastergui/', permanent=True))),
 )
 
 import toastermain.settings
-- 
1.9.1




More information about the bitbake-devel mailing list