projects
/
mediagoblin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8998300
)
Modify deleteuser to fail gracefully
author
ayleph
<ayleph@thisshitistemp.com>
Tue, 16 Sep 2014 22:29:09 +0000
(15:29 -0700)
committer
ayleph
<ayleph@thisshitistemp.com>
Tue, 16 Sep 2014 22:29:09 +0000
(15:29 -0700)
bin/gmg deleteuser will produce a traceback error if you attempt to delete a
user who does not exist. This commit provides a fix to allow deletuser to fail
gracefully.
This commit addresses https://issues.mediagoblin.org/ticket/969
mediagoblin/gmg_commands/users.py
patch
|
blob
|
blame
|
history
diff --git
a/mediagoblin/gmg_commands/users.py
b/mediagoblin/gmg_commands/users.py
index 71149497b2aa81f18a444185f2bfc2c739a4ed5a..d34f50e2d395007bf621eddcfdf6c607522dd558 100644
(file)
--- a/
mediagoblin/gmg_commands/users.py
+++ b/
mediagoblin/gmg_commands/users.py
@@
-129,7
+129,7
@@
def deleteuser(args):
db = mg_globals.database
user = db.User.query.filter_by(
- username=unicode(args.username.lower())).
one
()
+ username=unicode(args.username.lower())).
first
()
if user:
user.delete()
print 'The user %s has been deleted' % args.username