diff options
Diffstat (limited to 'poky/bitbake/lib/toaster/toastergui')
-rw-r--r-- | poky/bitbake/lib/toaster/toastergui/urls.py | 2 | ||||
-rw-r--r-- | poky/bitbake/lib/toaster/toastergui/views.py | 6 | ||||
-rw-r--r-- | poky/bitbake/lib/toaster/toastergui/widgets.py | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/poky/bitbake/lib/toaster/toastergui/urls.py b/poky/bitbake/lib/toaster/toastergui/urls.py index d2df4e6048..bc3b0c79d8 100644 --- a/poky/bitbake/lib/toaster/toastergui/urls.py +++ b/poky/bitbake/lib/toaster/toastergui/urls.py @@ -6,7 +6,7 @@ # SPDX-License-Identifier: GPL-2.0-only # -from django.conf.urls import url +from django.urls import re_path as url from django.views.generic import RedirectView from toastergui import tables diff --git a/poky/bitbake/lib/toaster/toastergui/views.py b/poky/bitbake/lib/toaster/toastergui/views.py index a571b8cc18..552ff1649b 100644 --- a/poky/bitbake/lib/toaster/toastergui/views.py +++ b/poky/bitbake/lib/toaster/toastergui/views.py @@ -670,11 +670,11 @@ def xhr_dirinfo(request, build_id, target_id): return HttpResponse(_get_dir_entries(build_id, target_id, top), content_type = "application/json") from django.utils.functional import Promise -from django.utils.encoding import force_text +from django.utils.encoding import force_str class LazyEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, Promise): - return force_text(obj) + return force_str(obj) return super(LazyEncoder, self).default(obj) from toastergui.templatetags.projecttags import filtered_filesizeformat @@ -1404,7 +1404,7 @@ if True: if not os.path.isdir('%s/conf' % request.POST['importdir']): raise BadParameterException("Bad path or missing 'conf' directory (%s)" % request.POST['importdir']) from django.core import management - management.call_command('buildimport', '--command=import', '--name=%s' % request.POST['projectname'], '--path=%s' % request.POST['importdir'], interactive=False) + management.call_command('buildimport', '--command=import', '--name=%s' % request.POST['projectname'], '--path=%s' % request.POST['importdir']) prj = Project.objects.get(name = request.POST['projectname']) prj.merged_attr = True prj.save() diff --git a/poky/bitbake/lib/toaster/toastergui/widgets.py b/poky/bitbake/lib/toaster/toastergui/widgets.py index ceff52942e..53696912a4 100644 --- a/poky/bitbake/lib/toaster/toastergui/widgets.py +++ b/poky/bitbake/lib/toaster/toastergui/widgets.py @@ -7,6 +7,7 @@ # from django.views.generic import View, TemplateView +from django.utils.decorators import method_decorator from django.views.decorators.cache import cache_control from django.shortcuts import HttpResponse from django.core.cache import cache @@ -63,8 +64,8 @@ class ToasterTable(TemplateView): self.default_orderby = "" # prevent HTTP caching of table data - @cache_control(must_revalidate=True, - max_age=0, no_store=True, no_cache=True) + @method_decorator(cache_control(must_revalidate=True, + max_age=0, no_store=True, no_cache=True)) def dispatch(self, *args, **kwargs): return super(ToasterTable, self).dispatch(*args, **kwargs) |