Skip to content

Set permissions after migrating #102

@XanderVertegaal

Description

@XanderVertegaal

When setting up a new server and running migrations for the first time, you currently get warning about non-existent permissions. This is because 0004_create_user_groups.py (in the user app) tries to add permissions to user groups while the permissions themselves do not exist. Apparently, Django only creates these after running migrations (in the post_migrate signal, using create_permissions, cf. django.contrib.auth.apps.AuthConfig).

You can get around this by undoing and redoing the last migration

python manage.py migrate user 0003
python manage.py migrate user

Needless to say this is not a very nice setup. To solve this we could write a separate, idempotent script that is run after all migrations have been run and that sets all group permissions according to the overview in backend/user/permissions.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions