1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pyinventory_ynh.git synced 2024-09-03 20:16:09 +02:00
pyinventory_ynh/conf/setup_user.py

15 lines
415 B
Python
Raw Normal View History

from inventory.permissions import get_or_create_normal_user_group
2020-12-29 13:58:40 +01:00
def setup_project_user(user):
"""
All users used the Django admin, so we need to set the "staff" user flag.
Called from django_yunohost_integration.sso_auth
2020-12-29 13:58:40 +01:00
"""
pyinventory_user_group = get_or_create_normal_user_group()[0]
user.groups.set([pyinventory_user_group])
2020-12-29 13:58:40 +01:00
user.is_staff = True
user.save()
return user