diff options
author | David Reyna <David.Reyna@windriver.com> | 2023-08-28 01:45:18 -0700 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2023-08-29 16:39:58 +0200 |
commit | 4f5b1f5bede402295bf4dfc8845fe2f38973e157 (patch) | |
tree | a60426b404e09a8a9c7a403a7df3eccc5ebb25de | |
parent | 2117db3146ce38bb4a6e2df40b6cd2ab11b514d5 (diff) | |
download | bitbake-4f5b1f5bede402295bf4dfc8845fe2f38973e157.tar.gz |
toaster: Update to Django 4.2
Update Toaster to support Django 4.2, to match current
hosts and to address CVEs.
[YOCTO #15152]
Signed-off-by: Kieran McNulty <Kieran.McNulty@windriver.com>
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r-- | lib/toaster/bldcollector/urls.py | 2 | ||||
-rw-r--r-- | lib/toaster/bldcontrol/models.py | 4 | ||||
-rw-r--r-- | lib/toaster/toastergui/urls.py | 2 | ||||
-rw-r--r-- | lib/toaster/toastergui/views.py | 4 | ||||
-rw-r--r-- | lib/toaster/toastergui/widgets.py | 5 | ||||
-rw-r--r-- | lib/toaster/toastermain/management/commands/checksocket.py | 4 | ||||
-rw-r--r-- | lib/toaster/toastermain/urls.py | 2 | ||||
-rw-r--r-- | toaster-requirements.txt | 2 |
8 files changed, 13 insertions, 12 deletions
diff --git a/lib/toaster/bldcollector/urls.py b/lib/toaster/bldcollector/urls.py index efd67a81a..3c3407035 100644 --- a/lib/toaster/bldcollector/urls.py +++ b/lib/toaster/bldcollector/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 import bldcollector.views diff --git a/lib/toaster/bldcontrol/models.py b/lib/toaster/bldcontrol/models.py index c2f302da2..42750e718 100644 --- a/lib/toaster/bldcontrol/models.py +++ b/lib/toaster/bldcontrol/models.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals from django.db import models -from django.utils.encoding import force_text +from django.utils.encoding import force_str from orm.models import Project, Build, Layer_Version import logging @@ -124,7 +124,7 @@ class BuildRequest(models.Model): return self.brvariable_set.get(name="MACHINE").value def __str__(self): - return force_text('%s %s' % (self.project, self.get_state_display())) + return force_str('%s %s' % (self.project, self.get_state_display())) # These tables specify the settings for running an actual build. # They MUST be kept in sync with the tables in orm.models.Project* diff --git a/lib/toaster/toastergui/urls.py b/lib/toaster/toastergui/urls.py index d2df4e604..bc3b0c79d 100644 --- a/lib/toaster/toastergui/urls.py +++ b/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/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py index a571b8cc1..bf92510cd 100644 --- a/lib/toaster/toastergui/views.py +++ b/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 diff --git a/lib/toaster/toastergui/widgets.py b/lib/toaster/toastergui/widgets.py index ceff52942..53696912a 100644 --- a/lib/toaster/toastergui/widgets.py +++ b/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) diff --git a/lib/toaster/toastermain/management/commands/checksocket.py b/lib/toaster/toastermain/management/commands/checksocket.py index 811fd5d51..b2c002da7 100644 --- a/lib/toaster/toastermain/management/commands/checksocket.py +++ b/lib/toaster/toastermain/management/commands/checksocket.py @@ -13,7 +13,7 @@ import errno import socket from django.core.management.base import BaseCommand, CommandError -from django.utils.encoding import force_text +from django.utils.encoding import force_str DEFAULT_ADDRPORT = "0.0.0.0:8000" @@ -51,7 +51,7 @@ class Command(BaseCommand): if hasattr(err, 'errno') and err.errno in errors: errtext = errors[err.errno] else: - errtext = force_text(err) + errtext = force_str(err) raise CommandError(errtext) self.stdout.write("OK") diff --git a/lib/toaster/toastermain/urls.py b/lib/toaster/toastermain/urls.py index 5fb520b38..036030266 100644 --- a/lib/toaster/toastermain/urls.py +++ b/lib/toaster/toastermain/urls.py @@ -6,7 +6,7 @@ # SPDX-License-Identifier: GPL-2.0-only # -from django.conf.urls import include, url +from django.urls import re_path as url, include from django.views.generic import RedirectView, TemplateView from django.views.decorators.cache import never_cache import bldcollector.views diff --git a/toaster-requirements.txt b/toaster-requirements.txt index dedd42355..c1f433f9e 100644 --- a/toaster-requirements.txt +++ b/toaster-requirements.txt @@ -1,3 +1,3 @@ -Django>3.2,<3.3 +Django>4.2,<4.3 beautifulsoup4>=4.4.0 pytz |