mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
app: Fix build issue with Django 5.x
Closes: #1131272 (Debian) Tests: - With Django 4.2 (stable container), syncthing app installs properly and home page shows the tags properly. - With Django 6.0 (unstable+experimental container), syncthing app installs properly and home page shows the tags properly. - With a cowbuilder base image of Ubuntu resolute distribution, freedombox package builds successfully with gbp. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
This commit is contained in:
parent
7d3c4812e9
commit
c66e78c203
@ -574,10 +574,19 @@ class Info(FollowerComponent):
|
|||||||
except ImproperlyConfigured:
|
except ImproperlyConfigured:
|
||||||
# Hack to allow apps to be instantiated without Django
|
# Hack to allow apps to be instantiated without Django
|
||||||
# initialization as required by privileged process.
|
# initialization as required by privileged process.
|
||||||
return [
|
def _make_str(tag):
|
||||||
tag._proxy____args[0] if isinstance(tag, Promise) else tag
|
"""Return the string without casting."""
|
||||||
for tag in self._tags
|
if not isinstance(tag, Promise):
|
||||||
]
|
return tag
|
||||||
|
|
||||||
|
# Django 4.2
|
||||||
|
if hasattr(tag, '_proxy____args'):
|
||||||
|
return tag._proxy____args[0]
|
||||||
|
|
||||||
|
# Django 5.x
|
||||||
|
return tag._args[0]
|
||||||
|
|
||||||
|
return [_make_str(tag) for tag in self._tags]
|
||||||
|
|
||||||
|
|
||||||
class EnableState(LeaderComponent):
|
class EnableState(LeaderComponent):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user