Hi Team,
What would be the best way to undo an accidental press of the "Restrict Dimagi Staff Access" checkbox as per Figure 1 on a Stand Alone instance? The Project administration is no longer accessible to the user who created the project.
Figure 1: The button which has accidentally been pressed
Is the user a member of the project? If so, I believe they should still have access. Assuming they're not, you can have another user invite them, which should restore access (or have another user disable the setting).
Assuming you have no users with appropriate access, you'd have to do this via the Django shell:
$ cchq production django-manage shell
and then in the shell:
from corehq.apps.domain.models import Domain
domain = Domain.get_by_name(PROJECT_NAME)
domain.restrict_superusers = False
domain.save()
1 Like
Hi Ethan,
Thank you so much for the helpful and quick response!
The Django Shell fix worked for me. The App Name was a bit of an issue for me, as the name displayed by a simple print was not the same as the name of the actual project. So I had to use the code in Listing 2 to get the names correctly - Not the names I was using in Listing 1.
Thanks again!
In [30]: dids = Domain.get_all()
In [31]: for a in dids:
...: print(a)
...:
Dirk_Proj1
Dirk_Proj2
Testing sandpatch
...
Listing 1. Code used to print the incorrect project names
In [40]: for a in dids:
...: print(a.name)
...:
dirk-proj1
dirk-proj2
testing
...
Listing 2. Code used to print the correct project names