提交 c35d07c3 编写于 作者: N Nikita Manovich 提交者: Andrey Zhavoronkov

Fix LDAP auth for new users. (#192)

上级 608253f1
......@@ -25,5 +25,9 @@ def create_user(sender, user=None, ldap_user=None, **kwargs):
if role == AUTH_ROLE.ADMIN:
user.is_staff = user.is_superuser = True
user.groups.set(user_groups)
# It is important to save the user before adding groups. Please read
# https://django-auth-ldap.readthedocs.io/en/latest/users.html#populating-users
# The user instance will be saved automatically after the signal handler
# is run.
user.save()
user.groups.set(user_groups)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册