diff options
| author | David Reyna <David.Reyna@windriver.com> | 2023-08-28 01:45:18 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-08-30 10:41:54 +0100 |
| commit | 9ccaee95d6afc65d528b469d16b4719733768ef6 (patch) | |
| tree | d6101a730c67d03f65c25486efecaf7031a64fb5 /bitbake/lib/toaster/toastergui | |
| parent | 10f38157a069cb6938323cadd5e523037a29ace9 (diff) | |
| download | poky-9ccaee95d6afc65d528b469d16b4719733768ef6.tar.gz | |
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>
Diffstat (limited to 'bitbake/lib/toaster/toastergui')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/urls.py | 2 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/views.py | 4 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/widgets.py | 5 |
3 files changed, 6 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py index d2df4e6048..bc3b0c79d8 100644 --- a/bitbake/lib/toaster/toastergui/urls.py +++ b/bitbake/lib/toaster/toastergui/urls.py | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | # SPDX-License-Identifier: GPL-2.0-only | 6 | # SPDX-License-Identifier: GPL-2.0-only |
| 7 | # | 7 | # |
| 8 | 8 | ||
| 9 | from django.conf.urls import url | 9 | from django.urls import re_path as url |
| 10 | from django.views.generic import RedirectView | 10 | from django.views.generic import RedirectView |
| 11 | 11 | ||
| 12 | from toastergui import tables | 12 | from toastergui import tables |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index a571b8cc18..bf92510cdc 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
| @@ -670,11 +670,11 @@ def xhr_dirinfo(request, build_id, target_id): | |||
| 670 | return HttpResponse(_get_dir_entries(build_id, target_id, top), content_type = "application/json") | 670 | return HttpResponse(_get_dir_entries(build_id, target_id, top), content_type = "application/json") |
| 671 | 671 | ||
| 672 | from django.utils.functional import Promise | 672 | from django.utils.functional import Promise |
| 673 | from django.utils.encoding import force_text | 673 | from django.utils.encoding import force_str |
| 674 | class LazyEncoder(json.JSONEncoder): | 674 | class LazyEncoder(json.JSONEncoder): |
| 675 | def default(self, obj): | 675 | def default(self, obj): |
| 676 | if isinstance(obj, Promise): | 676 | if isinstance(obj, Promise): |
| 677 | return force_text(obj) | 677 | return force_str(obj) |
| 678 | return super(LazyEncoder, self).default(obj) | 678 | return super(LazyEncoder, self).default(obj) |
| 679 | 679 | ||
| 680 | from toastergui.templatetags.projecttags import filtered_filesizeformat | 680 | from toastergui.templatetags.projecttags import filtered_filesizeformat |
diff --git a/bitbake/lib/toaster/toastergui/widgets.py b/bitbake/lib/toaster/toastergui/widgets.py index ceff52942e..53696912a4 100644 --- a/bitbake/lib/toaster/toastergui/widgets.py +++ b/bitbake/lib/toaster/toastergui/widgets.py | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | # | 7 | # |
| 8 | 8 | ||
| 9 | from django.views.generic import View, TemplateView | 9 | from django.views.generic import View, TemplateView |
| 10 | from django.utils.decorators import method_decorator | ||
| 10 | from django.views.decorators.cache import cache_control | 11 | from django.views.decorators.cache import cache_control |
| 11 | from django.shortcuts import HttpResponse | 12 | from django.shortcuts import HttpResponse |
| 12 | from django.core.cache import cache | 13 | from django.core.cache import cache |
| @@ -63,8 +64,8 @@ class ToasterTable(TemplateView): | |||
| 63 | self.default_orderby = "" | 64 | self.default_orderby = "" |
| 64 | 65 | ||
| 65 | # prevent HTTP caching of table data | 66 | # prevent HTTP caching of table data |
| 66 | @cache_control(must_revalidate=True, | 67 | @method_decorator(cache_control(must_revalidate=True, |
| 67 | max_age=0, no_store=True, no_cache=True) | 68 | max_age=0, no_store=True, no_cache=True)) |
| 68 | def dispatch(self, *args, **kwargs): | 69 | def dispatch(self, *args, **kwargs): |
| 69 | return super(ToasterTable, self).dispatch(*args, **kwargs) | 70 | return super(ToasterTable, self).dispatch(*args, **kwargs) |
| 70 | 71 | ||
