1
0
Fork 0

auth: fix broken deletion permission on non-superusers

This commit is contained in:
Piotr Dobrowolski 2020-05-28 21:53:58 +02:00
parent 3de626d5c5
commit 3b5439ef74
1 changed files with 5 additions and 0 deletions

View File

@ -1,8 +1,13 @@
from social_core.pipeline.social_auth import associate_by_email
from django.contrib.auth.models import Group
def staff_me_up(backend, details, response, uid, user, *args, **kwargs):
user.is_staff = True
try:
user.groups.set([Group.objects.get(name='member')])
except Group.DoesNotExist:
pass
user.save()