mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-25 09:21:10 +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:
|
||||
# Hack to allow apps to be instantiated without Django
|
||||
# initialization as required by privileged process.
|
||||
return [
|
||||
tag._proxy____args[0] if isinstance(tag, Promise) else tag
|
||||
for tag in self._tags
|
||||
]
|
||||
def _make_str(tag):
|
||||
"""Return the string without casting."""
|
||||
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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user