Commit 591218e2 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Pre 0.13 migration diagnostic scripts improvements

Display user date_joined and is_active fields
parent 32a981c5
......@@ -24,12 +24,13 @@ id_list = [int(x) for x in argv[1:]]
print ""
print "This will permanently delete the following users:\n"
print "id: email"
print "-- -----"
print "id email (is_active, creation date)"
print "-- --------------------------------"
users = A.objects.filter(id__in=id_list)
for user in users:
print "%s: %s" % (user.id, user.email)
print "%s: %s (%s, %s)" % (user.id, user.email, user.is_active,
user.date_joined)
print "\nExecute? (yes/no): ",
line = raw_input().rstrip()
......
......@@ -12,8 +12,8 @@ def user_filter(user):
return A.objects.filter(email__iexact=user.email).count() > 1
all_users = list(A.objects.all())
userlist = [(str(u.pk) + ': ' + str(u.email)) for u in
filter(user_filter, all_users)]
userlist = [(str(u.pk) + ': ' + str(u.email) + '(' + str(u.is_active) + ', ' +
str(u.date_joined) + ')') for u in filter(user_filter, all_users)]
sys.stderr.write("id: email\n")
sys.stderr.write("id email (is_active, creation date)\n")
print "\n".join(userlist)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment