comparison gpp/legacy/management/commands/import_old_news.py @ 535:4021ea1045f7

Adding import commands for the 1.0 POTD & comments.
author Brian Neal <bgneal@gmail.com>
date Sat, 31 Dec 2011 21:34:17 +0000
parents 254db4cb6a86
children
comparison
equal deleted inserted replaced
534:98f5facc0030 535:4021ea1045f7
108 pass 108 pass
109 109
110 try: 110 try:
111 user = User.objects.get(username=username) 111 user = User.objects.get(username=username)
112 except User.DoesNotExist: 112 except User.DoesNotExist:
113 old_name = username.lower()
113 try: 114 try:
114 user = User.objects.get( 115 user = User.objects.get(
115 username=legacy.data.KNOWN_USERNAME_CHANGES[username]) 116 username=legacy.data.KNOWN_USERNAME_CHANGES[old_name])
116 except KeyError: 117 except KeyError:
117 raise User.DoesNotExist 118 raise User.DoesNotExist
118 119
119 self.users[username] = user 120 self.users[username] = user
120 return user 121 return user