comparison gpp/legacy/management/commands/import_old_news_comments.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
103 pass 103 pass
104 104
105 try: 105 try:
106 user = User.objects.get(username=username) 106 user = User.objects.get(username=username)
107 except User.DoesNotExist: 107 except User.DoesNotExist:
108 old_name = username.lower()
108 try: 109 try:
109 user = User.objects.get( 110 user = User.objects.get(
110 username=legacy.data.KNOWN_USERNAME_CHANGES[username]) 111 username=legacy.data.KNOWN_USERNAME_CHANGES[old_name])
111 except KeyError: 112 except KeyError:
112 raise User.DoesNotExist 113 raise User.DoesNotExist
113 114
114 self.users[username] = user 115 self.users[username] = user
115 return user 116 return user