random effect of box 'disable all submissions'
This issue comes after the PR #3135 has been merged on develop and set on pre-prod and prod servers: After applying migrations and launching new dockers, the box can is seen by a platform admin and can be ticked. But the behavior is not stable: on pre-prod server as well as on py3 production server, submissions are sometimes blocked, sometimes not. Nothing obvious can explain the difference.
Some news from Tyler:
There's a bug I did not catch when I tested this, but the behavior is not consistent. It seems to always work on the first try, but subsequent tries do not.
The value (settings.DISABLE_ALL_SUBMISSIONS) is set per worker in-memory instead of being retrieved from the DB or set via a config file. The reference to what is being checked can probably be changed to fix the issue as it is also tied into the DB by a model. Tristan was mainly following the pattern Eric had done for this, but in this case it seems there may be an unintended bug.
>>> Configuration.objects.first().disable_all_submissions
True
>>> settings.DISABLE_ALL_SUBMISSIONS
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/django/conf/__init__.py", line 57, in __getattr__
val = getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'DISABLE_ALL_SUBMISSIONS'
>>> settings.DISABLE_SUBMISSIONS
False
Even if the box is unchecked, an user reported a submission blocked: #3146