summaryrefslogtreecommitdiff
path: root/admin.py
diff options
context:
space:
mode:
authorRichard Jones <richard@mechanicalcat.net>2013-02-14 14:23:41 +1100
committerRichard Jones <richard@mechanicalcat.net>2013-02-14 14:23:41 +1100
commitacd3f6f37de42e55093884ac31d2e477d7c9c819 (patch)
tree730a05c6ecee625425b7842286990973a9128756 /admin.py
parentf376646bdb82142840fa7cedbe846fbed736a011 (diff)
downloaddecorator-acd3f6f37de42e55093884ac31d2e477d7c9c819.tar.gz
improved password reset with no emailing of passwords
Diffstat (limited to 'admin.py')
-rw-r--r--admin.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/admin.py b/admin.py
index 7ed980b..ab51a66 100644
--- a/admin.py
+++ b/admin.py
@@ -187,6 +187,16 @@ def merge_user(store, old, new):
c.execute('update comments_journal set submitted_by=%s where submitted_by=%s', (new, old))
c.execute('delete from users where name=%s', (old,))
+def show_user(store, user):
+ c = store.get_cursor()
+ user = store.get_user()
+ if not user:
+ sys.exit('user %r does not exist' % user)
+ for key in user.keys():
+ print '%s: %s' % (key, user[key])
+ for p in store.get_user_packages(user):
+ print '%s: %s' % (p['package_name'], p['role_name'])
+
def nuke_nested_lists(store, confirm=False):
c = store.get_cursor()
c.execute("""select name, version, summary from releases
@@ -257,6 +267,8 @@ if __name__ == '__main__':
nuke_nested_lists(*args)
elif command == 'keyrotate':
keyrotate(config, *args)
+ elif command == 'user':
+ show_user(*args)
else:
print "unknown command '%s'!"%command
st.changed()