Revert "auth: do not automatically staff new members"
This reverts commit 0fa9762bea
.
This commit is contained in:
parent
8ce869393e
commit
f92635f5f3
|
@ -2,6 +2,15 @@ from social_core.pipeline.social_auth import associate_by_email
|
||||||
from django.contrib.auth.models import Group
|
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()
|
||||||
|
|
||||||
|
|
||||||
def associate_by_personal_email(backend, details, user=None, *args, **kwargs):
|
def associate_by_personal_email(backend, details, user=None, *args, **kwargs):
|
||||||
return associate_by_email(
|
return associate_by_email(
|
||||||
backend,
|
backend,
|
||||||
|
|
|
@ -163,6 +163,7 @@ SOCIAL_AUTH_PIPELINE = (
|
||||||
"social_core.pipeline.social_auth.associate_user",
|
"social_core.pipeline.social_auth.associate_user",
|
||||||
"social_core.pipeline.social_auth.load_extra_data",
|
"social_core.pipeline.social_auth.load_extra_data",
|
||||||
"social_core.pipeline.user.user_details",
|
"social_core.pipeline.user.user_details",
|
||||||
|
"auth.pipeline.staff_me_up",
|
||||||
)
|
)
|
||||||
|
|
||||||
STORAGES = {
|
STORAGES = {
|
||||||
|
|
Loading…
Reference in New Issue