mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00
bitbake: toaster: Update to Django 4.2
Update Toaster to support Django 4.2, to match current hosts and to address CVEs. [YOCTO #15152] (Bitbake rev: 4f5b1f5bede402295bf4dfc8845fe2f38973e157) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
10f38157a0
commit
9ccaee95d6
|
@ -6,7 +6,7 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
#
|
#
|
||||||
|
|
||||||
from django.conf.urls import url
|
from django.urls import re_path as url
|
||||||
|
|
||||||
import bldcollector.views
|
import bldcollector.views
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from django.db import models
|
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
|
from orm.models import Project, Build, Layer_Version
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
@ -124,7 +124,7 @@ class BuildRequest(models.Model):
|
||||||
return self.brvariable_set.get(name="MACHINE").value
|
return self.brvariable_set.get(name="MACHINE").value
|
||||||
|
|
||||||
def __str__(self):
|
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.
|
# These tables specify the settings for running an actual build.
|
||||||
# They MUST be kept in sync with the tables in orm.models.Project*
|
# They MUST be kept in sync with the tables in orm.models.Project*
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# 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 django.views.generic import RedirectView
|
||||||
|
|
||||||
from toastergui import tables
|
from toastergui import tables
|
||||||
|
|
|
@ -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")
|
return HttpResponse(_get_dir_entries(build_id, target_id, top), content_type = "application/json")
|
||||||
|
|
||||||
from django.utils.functional import Promise
|
from django.utils.functional import Promise
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_str
|
||||||
class LazyEncoder(json.JSONEncoder):
|
class LazyEncoder(json.JSONEncoder):
|
||||||
def default(self, obj):
|
def default(self, obj):
|
||||||
if isinstance(obj, Promise):
|
if isinstance(obj, Promise):
|
||||||
return force_text(obj)
|
return force_str(obj)
|
||||||
return super(LazyEncoder, self).default(obj)
|
return super(LazyEncoder, self).default(obj)
|
||||||
|
|
||||||
from toastergui.templatetags.projecttags import filtered_filesizeformat
|
from toastergui.templatetags.projecttags import filtered_filesizeformat
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
from django.views.generic import View, TemplateView
|
from django.views.generic import View, TemplateView
|
||||||
|
from django.utils.decorators import method_decorator
|
||||||
from django.views.decorators.cache import cache_control
|
from django.views.decorators.cache import cache_control
|
||||||
from django.shortcuts import HttpResponse
|
from django.shortcuts import HttpResponse
|
||||||
from django.core.cache import cache
|
from django.core.cache import cache
|
||||||
|
@ -63,8 +64,8 @@ class ToasterTable(TemplateView):
|
||||||
self.default_orderby = ""
|
self.default_orderby = ""
|
||||||
|
|
||||||
# prevent HTTP caching of table data
|
# prevent HTTP caching of table data
|
||||||
@cache_control(must_revalidate=True,
|
@method_decorator(cache_control(must_revalidate=True,
|
||||||
max_age=0, no_store=True, no_cache=True)
|
max_age=0, no_store=True, no_cache=True))
|
||||||
def dispatch(self, *args, **kwargs):
|
def dispatch(self, *args, **kwargs):
|
||||||
return super(ToasterTable, self).dispatch(*args, **kwargs)
|
return super(ToasterTable, self).dispatch(*args, **kwargs)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import errno
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
from django.core.management.base import BaseCommand, CommandError
|
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"
|
DEFAULT_ADDRPORT = "0.0.0.0:8000"
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class Command(BaseCommand):
|
||||||
if hasattr(err, 'errno') and err.errno in errors:
|
if hasattr(err, 'errno') and err.errno in errors:
|
||||||
errtext = errors[err.errno]
|
errtext = errors[err.errno]
|
||||||
else:
|
else:
|
||||||
errtext = force_text(err)
|
errtext = force_str(err)
|
||||||
raise CommandError(errtext)
|
raise CommandError(errtext)
|
||||||
|
|
||||||
self.stdout.write("OK")
|
self.stdout.write("OK")
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# 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.generic import RedirectView, TemplateView
|
||||||
from django.views.decorators.cache import never_cache
|
from django.views.decorators.cache import never_cache
|
||||||
import bldcollector.views
|
import bldcollector.views
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
Django>3.2,<3.3
|
Django>4.2,<4.3
|
||||||
beautifulsoup4>=4.4.0
|
beautifulsoup4>=4.4.0
|
||||||
pytz
|
pytz
|
||||||
|
|
Loading…
Reference in New Issue
Block a user