This repository has been archived by the owner on Jan 26, 2021. It is now read-only.
Create user groups and assign permissions on post_syncdb signal #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The following change is dependent on #9 and makes assumptions about model class names, since default permissions are created using those.
This PR will be changed accordingly and rebased against merged models. The manual testing was done using dummy models, but doesn't include those, nor the app
__init__.py
or updates inbase.py
settings.The user groups define 4 different levels of access. The admin level is not included, since this is the Systers Keeper and by becoming Django superuser she has access to everything via admin panel.
I have written a test for the following change, but it fails, because the order of running syncdb handlers is different in test mode. By running
python manage.py syncdb
the order is the following:When running
python manage.py test
:create_user_groups
tries to get permission objects from the database, but those were not yet insertedIs it possible to force a specific order on syncdb execution in test mode? Or maybe there is a better way to solve the issue?