Skip to content

Commit

Permalink
[bug 570654] Giving FakeUser a FakeEmail and making build_avatars ski…
Browse files Browse the repository at this point in the history
…p missing email addresses.
  • Loading branch information
James Socol committed Jun 8, 2010
1 parent 0a3d36c commit dc17012
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions apps/forums/management/commands/migrate_forum.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ def get_fake_user():
return User.objects.get(username='FakeUser')
except User.DoesNotExist:
tiki_user = TikiUser.objects.create(
login='FakeUser', password='md5$pass', hash='md5$hash')
login='FakeUser', password='md5$pass', hash='md5$hash',
email='[email protected]')
return User.objects.create(
id=tiki_user.userId, username='FakeUser')
id=tiki_user.userId, username='FakeUser',
email='[email protected]')


def get_django_user(tiki_thread):
Expand Down
5 changes: 4 additions & 1 deletion lib/identicons/management/commands/build_avatars.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def handle(self, **options):
for u in users:
print 'Hashing %s' % u.login
# Ugh, this part gets ugly.
h = hashlib.md5(u.email.encode('utf-8')).hexdigest()
try:
h = hashlib.md5(u.email.encode('utf-8')).hexdigest()
except AttributeError:
continue
i = int(h, 16)
iname = '/tmp/%s.png' % h

Expand Down

0 comments on commit dc17012

Please sign in to comment.