summaryrefslogtreecommitdiff
path: root/tools/migrate_user.py
diff options
context:
space:
mode:
authorroot <root@lalalizard.com>2012-12-21 13:52:25 -0500
committerroot <root@lalalizard.com>2012-12-21 13:52:25 -0500
commitdb1e4fb6a16bec535337916cf5578f2cb0097423 (patch)
tree1cb1efbf6fe70bb176d1a2d58fa8d4d5343d03ad /tools/migrate_user.py
parentabb7bcf38ed21856c2fdadc3f4bccfc37ad8c4c3 (diff)
migration tools fix
Diffstat (limited to 'tools/migrate_user.py')
-rwxr-xr-xtools/migrate_user.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/migrate_user.py b/tools/migrate_user.py
index bf941f6..6147847 100755
--- a/tools/migrate_user.py
+++ b/tools/migrate_user.py
@@ -99,19 +99,24 @@ if __name__ == '__main__':
for row in sj_user:
try:
user = User.objects.get(username=row['username'])
+ print "user '%s' already exist" % user.username
except User.DoesNotExist:
user = User.objects.create_user(
row['username'],
'%s@example.com' % row['username'],
row['password']
)
+ print "user '%s' created" % user.username
+
try:
user_profile = user.get_profile()
+ print "profile for '%s' exist" % user.username
except django.core.exceptions.ObjectDoesNotExist:
user_profile = SJUserProfile(user=user)
user_profile.lastseen_chat = datetime.fromtimestamp(0)
user_profile.lastseen_webcam = datetime.fromtimestamp(0)
user_profile.save()
+ print "profile for '%s' created" % user.username
user.date_joined = datetime.fromtimestamp(row['joindate'])
user.last_login = datetime.fromtimestamp(row['seendate'])