#939497 AttributeError: 'method' object has no attribute 'STRONGHOLD_IS_PUBLIC'

Package:
python3-django-stronghold
Source:
django-stronghold
Submitter:
James Valleroy
Date:
2022-07-15 14:39:10 UTC
Severity:
important
Tags:
#939497#5
Date:
2019-09-05 14:49:15 UTC
From:
To:
Dear Maintainer,

While running FreedomBox on Debian unstable (in vagrant box, and
development mode), I installed the JSXC app and opened it. I got the
following django error page:


AttributeError at /apps/jsxc/jsxc/

'method' object has no attribute 'STRONGHOLD_IS_PUBLIC'


Environment:


Request Method: GET
Request URL: https://localhost:4430/plinth/apps/jsxc/jsxc/

Django Version: 2.2.5
Python Version: 3.7.4
Installed Applications:
['axes',
 'captcha',
 'bootstrapform',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.messages',
 'stronghold',
 'plinth',
 'plinth.modules.minetest',
 'plinth.modules.searx',
 'plinth.modules.ejabberd',
 'plinth.modules.syncthing',
 'plinth.modules.openvpn',
 'plinth.modules.shadowsocks',
 'plinth.modules.monkeysphere',
 'plinth.modules.ttrss',
 'plinth.modules.transmission',
 'plinth.modules.mldonkey',
 'plinth.modules.help',
 'plinth.modules.radicale',
 'plinth.modules.api',
 'plinth.modules.mumble',
 'plinth.modules.mediawiki',
 'plinth.modules.cockpit',
 'plinth.modules.matrixsynapse',
 'plinth.modules.diagnostics',
 'plinth.modules.firewall',
 'plinth.modules.tor',
 'plinth.modules.avahi',
 'plinth.modules.power',
 'plinth.modules.i2p',
 'plinth.modules.quassel',
 'plinth.modules.users',
 'plinth.modules.apache',
 'plinth.modules.sso',
 'plinth.modules.ssh',
 'plinth.modules.sharing',
 'plinth.modules.upgrades',
 'plinth.modules.dynamicdns',
 'plinth.modules.backups',
 'plinth.modules.storage',
 'plinth.modules.tahoe',
 'plinth.modules.snapshot',
 'plinth.modules.roundcube',
 'plinth.modules.config',
 'plinth.modules.ikiwiki',
 'plinth.modules.deluge',
 'plinth.modules.networks',
 'plinth.modules.names',
 'plinth.modules.first_boot',
 'plinth.modules.infinoted',
 'plinth.modules.datetime',
 'plinth.modules.pagekite',
 'plinth.modules.privoxy',
 'plinth.modules.security',
 'plinth.modules.jsxc',
 'plinth.modules.bind',
 'plinth.modules.letsencrypt']
Installed Middleware:
('django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'stronghold.middleware.LoginRequiredMiddleware',
 'plinth.middleware.AdminRequiredMiddleware',
 'plinth.middleware.FirstSetupMiddleware',
 'plinth.modules.first_boot.middleware.FirstBootMiddleware',
 'plinth.middleware.SetupMiddleware')



Traceback:

File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/lib/python3/dist-packages/django/views/generic/base.py" in view
  71.             return self.dispatch(request, *args, **kwargs)

File "/usr/lib/python3/dist-packages/django/utils/decorators.py" in _wrapper
  44.             bound_method = dec(bound_method)

File "/usr/lib/python3/dist-packages/stronghold/decorators.py" in public
  13.     set_view_func_public(orig_func)

File "/usr/lib/python3/dist-packages/stronghold/utils.py" in set_view_func_public
  13.     setattr(func, 'STRONGHOLD_IS_PUBLIC', True)

Exception Type: AttributeError at /apps/jsxc/jsxc/
Exception Value: 'method' object has no attribute 'STRONGHOLD_IS_PUBLIC'


Appears to be the same as the upstream issue for Django 2.1
compatibility, reported here:
https://github.com/mgrouchy/django-stronghold/issues/75

#939497#16
Date:
2021-06-01 13:04:07 UTC
From:
To:
Please note that freedombox has implemented a workaround for this issue. The workaround is to avoid use of Django 2.1 decorator:

https://salsa.debian.org/freedombox-team/freedombox/-/commit/591ed5c4ae5d4154b66fb3c59b5ff54bcf53839b

So while it would be nice to get the fix from upstream, it is not strictly required to avoid the issue.

Therefore I would propose that the severity can be lowered.

#939497#23
Date:
2022-07-15 14:34:49 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
django-stronghold, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 939497@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
James Valleroy <jvalleroy@mailbox.org> (supplier of updated django-stronghold package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Fri, 15 Jul 2022 09:54:31 -0400
Source: django-stronghold
Architecture: source
Version: 0.4.0+debian-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <team+python@tracker.debian.org>
Changed-By: James Valleroy <jvalleroy@mailbox.org>
Closes: 939497 1013496
Changes:
 django-stronghold (0.4.0+debian-1) unstable; urgency=medium
 .
   * New upstream version 0.4.0 (Closes: #939497)
   * Drop patch to remove broken tests
   * Add patch to support Django 4.0 (Closes: #1013496)
   * Add myself to uploaders
   * Update copyright for debian/*
   * Add Rules-Requires-Root: no
   * Set Standards-Version to 4.6.1
Checksums-Sha1:
 450d923cde6f358c7f8bb610584d13ffc0c9350d 2325 django-stronghold_0.4.0+debian-1.dsc
 a122ac3b1eaa92dfa01a7009f5ecaacd4a819baa 13905 django-stronghold_0.4.0+debian.orig.tar.gz
 c61c6d83606c3f9b4680ea7faeff874570effbd2 3260 django-stronghold_0.4.0+debian-1.debian.tar.xz
 d57a7dc7bc8c7c8d8b5edaddd6c43b7222bdd45b 6908 django-stronghold_0.4.0+debian-1_amd64.buildinfo
Checksums-Sha256:
 d9be617a54bd3efeed32d18f4c870e47568d77eb123b5d7aa99254a6944d2a01 2325 django-stronghold_0.4.0+debian-1.dsc
 874a06b848c607ba0b9ed4f501c14c68995e186dc9a84ce43cded7aa169f821c 13905 django-stronghold_0.4.0+debian.orig.tar.gz
 5a7553b3e3b247d8116590b858f946b75061e939019ca11ab53e88dbbc65a9bf 3260 django-stronghold_0.4.0+debian-1.debian.tar.xz
 4625aa157056f442777626febc39777a09fba359d9774e89cba0c9be683509d2 6908 django-stronghold_0.4.0+debian-1_amd64.buildinfo
Files:
 5079409b05fc8513a540d259f7bcbba3 2325 python optional django-stronghold_0.4.0+debian-1.dsc
 dccb9dae991314ea4f052597bff7c617 13905 python optional django-stronghold_0.4.0+debian.orig.tar.gz
 5762f99629fdb0965ec02231c3657105 3260 python optional django-stronghold_0.4.0+debian-1.debian.tar.xz
 df4d6638c3f01119c41747ae4633e090 6908 python optional django-stronghold_0.4.0+debian-1_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJKBAEBCgA0FiEEfWrbdQ+RCFWJSEvmd8DHXntlCAgFAmLRchwWHGp2YWxsZXJv
eUBtYWlsYm94Lm9yZwAKCRB3wMdee2UICDaSD/9D5YLdbD32NUklpqqmFAeq++VE
i5+lgv5Dcd6QzAC1y0tEuUTMCs35OqmX3ul7qbkbyK5Ts4qO+o8bViKrTfvuuevZ
oFWS8wKi+PZqQUu+HLyHaYAoIPL5K67ul+744BJWA2/qeujfRJZva9q1uqQP2PHp
p122ZKoyZcIUbfesBxn3whoCplMi/3Xc8hffcdUbiaftu+esHoZP1RhPg6E8EPtl
aXWm3I19g7NqsZSta0/IF8Y1PZ5dS4Jj4DIA2JJbRqrDSHHp98Dn53grZfpaqksq
UR6Uzt96PldMqMJIWS0xQDGuf+q/9S/dpXGMaXQueZHNxIEuhDWsEaIYfrtpFWyY
Q7cdpkOc95Xm09mHM8ThpilQFScKcwDec9CPLC1Pbm/dYojPOPRQOgXn5ymyWcXP
DTy17HriQgeHkMvUDUOueWNoZPl6boizvhG+8/cF5uoRh36RRuRfTGyjwmCXMyT+
5RJIvj8ulk+oYsTPLDKItgPljHNeGiYsrafTFBzvEgRil8ZRN5aHShYpgmxrro4v
bLo6GFy7Ta0MOA8heyBz0bc3XJiau4VtUu24+2dwixXW2P3FhpMNptGMBk3Pu2MN
KHnixr478cZik/Ienks/Y2d8/tlwNnVDTQciYbwATmG0ykH59oasVHKyX+/vclLN
BS+Q8bpZ9jCkYkKcQA==
=S4ok
-----END PGP SIGNATURE-----