From c66e78c2038c8482357e20ed200049bd625553ea Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 19 Mar 2026 11:52:36 -0700 Subject: [PATCH] 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 Reviewed-by: Joseph Nuthalapati --- plinth/app.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/plinth/app.py b/plinth/app.py index 5d94554ae..745f18e94 100644 --- a/plinth/app.py +++ b/plinth/app.py @@ -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):