Browse Source

atualizando script de sincronizacao do ldap

stable/1.0
Felipe Vieira 13 years ago
parent
commit
c84cf1b7e0
  1. 9
      sigi/apps/servidores/management/commands/sync_ldap.py

9
sigi/apps/servidores/management/commands/sync_ldap.py

@ -61,7 +61,14 @@ class Command(BaseCommand):
except: last_name = ''
try: user = User.objects.get(username=username)
except User.DoesNotExist:
user = User.objects.create_user(username, email, username)
try:
user = User.objects.get(email=email)
user.username = username
except User.DoesNotExist:
user = User.objects.create_user(
username = username,
email = email
)
user.first_name = first_name
user.last_name = last_name
print "User '%s' created." % username

Loading…
Cancel
Save