Browse files

Fix some typos

  • Loading branch information...
1 parent d34fc95 commit 79681b28d954c0e358bdb3669adc78ac50a65e42 @davedash davedash committed Feb 7, 2012
Showing with 17 additions and 4 deletions.
  1. +17 −4 apps/users/cron.py
View
21 apps/users/cron.py
@@ -180,19 +180,32 @@ def _populate_from_ldap(profile):
log.warning('duplicat username found: %s' % username)
username = username + '_'
- profile.user.username = username
- profile.user.lastname = lastname
- profile.user.firstname = firstname
+ user = profile.user
+
+ user.username = username
+ user.lastname = lastname
+ user.firstname = firstname
+ user.save()
+
profile.bio = bio
profile.photo = bool(photo)
profile.display_name = displayname
profile.ircname = ircname
- profile.user.save()
profile.save()
log.debug('u:%d saved' % profile.user_id)
@cronjobs.register
+def flee_ldap_noname():
+ """Copies data from LDAP into UserProfile."""
+ users = User.objects.filter(last_name='')
+ print '%d profiles' % len(users)
+ for user in users:
+ print 'User: %d, %s' % (user.id, user.email)
+ _populate_from_ldap(user.get_profile())
+
+
+@cronjobs.register
def flee_ldap_nodisplay():
"""Copies data from LDAP into UserProfile."""
profiles = UserProfile.objects.filter(display_name='')

0 comments on commit 79681b2

Please sign in to comment.