diff gpp/legacy/management/commands/import_old_news.py @ 292:2367c4795c92

Added a legacy management command to import old news comments.
author Brian Neal <bgneal@gmail.com>
date Fri, 24 Dec 2010 22:20:30 +0000
parents a6357f2bcbbc
children 254db4cb6a86
line wrap: on
line diff
--- a/gpp/legacy/management/commands/import_old_news.py	Fri Dec 24 20:45:33 2010 +0000
+++ b/gpp/legacy/management/commands/import_old_news.py	Fri Dec 24 22:20:30 2010 +0000
@@ -12,11 +12,8 @@
 
 from news.models import Category, Story
 from legacy.phpbb import unescape
+import legacy.data
 
-KNOWN_USERNAME_CHANGES = {
-    'cavefishbutchdelux': 'butchdelux',
-    'Findicator1': 'WaveOhhh',
-}
 
 class Command(LabelCommand):
     args = '<filename filename ...>'
@@ -114,7 +111,8 @@
             user = User.objects.get(username=username)
         except User.DoesNotExist:
             try:
-                user = User.objects.get(username=KNOWN_USERNAME_CHANGES[username])
+                user = User.objects.get(
+                        username=legacy.data.KNOWN_USERNAME_CHANGES[username])
             except KeyError:
                 raise User.DoesNotExist