forked from wiktor/spejstore-new
auth: fix broken deletion permission on non-superusers
This commit is contained in:
parent
3de626d5c5
commit
3b5439ef74
|
@ -1,8 +1,13 @@
|
||||||
from social_core.pipeline.social_auth import associate_by_email
|
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):
|
def staff_me_up(backend, details, response, uid, user, *args, **kwargs):
|
||||||
user.is_staff = True
|
user.is_staff = True
|
||||||
|
try:
|
||||||
|
user.groups.set([Group.objects.get(name='member')])
|
||||||
|
except Group.DoesNotExist:
|
||||||
|
pass
|
||||||
user.save()
|
user.save()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue