Explorar o código

Add an LDAP user to the default group at import time

Jon Natkins %!s(int64=14) %!d(string=hai) anos
pai
achega
980aa3cb8a
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      apps/useradmin/src/useradmin/views.py

+ 4 - 0
apps/useradmin/src/useradmin/views.py

@@ -373,6 +373,10 @@ def _import_ldap_user(username, import_by_dn=False):
     LOG.warn('There was a naming conflict while importing user %s' % (username,))
     return None
 
+  default_group = get_default_user_group()
+  if created and default_group is not None:
+    user.groups.add(default_group)
+
   if 'first' in user_info:
     user.first_name = user_info['first']
   if 'last' in user_info: