aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-14 02:01:06 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-14 02:01:06 -0500
commit1bec5c0d3880a1cd848d765365104e221f390e71 (patch)
tree0e9a14e7985ae17a228f7b17b7bdedd7130024c7 /libbe/command
parent5e769027075ce0f95d5cf9006d097f7fe7d8b38d (diff)
downloadbugseverywhere-1bec5c0d3880a1cd848d765365104e221f390e71.tar.gz
Added parse_user() calls to Assign
Diffstat (limited to 'libbe/command')
-rw-r--r--libbe/command/assign.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/libbe/command/assign.py b/libbe/command/assign.py
index 2b4ed9f..287c649 100644
--- a/libbe/command/assign.py
+++ b/libbe/command/assign.py
@@ -34,19 +34,19 @@ class Assign (libbe.command.Command):
>>> bd.bug_from_uuid('a').assigned is None
True
- >>> cmd.run(bd, {'user-id':u'Fran\xe7ois'}, ['-', 'a'])
+ >>> cmd.run(bd, {'user-id':u'Fran\xe7ois'}, ['-', '/a'])
>>> bd.flush_reload()
>>> bd.bug_from_uuid('a').assigned
u'Fran\\xe7ois'
- >>> cmd.run(bd, args=['someone', 'a', 'b'])
+ >>> cmd.run(bd, args=['someone', '/a', '/b'])
>>> bd.flush_reload()
>>> bd.bug_from_uuid('a').assigned
'someone'
>>> bd.bug_from_uuid('b').assigned
'someone'
- >>> cmd.run(bd, args=['none', 'a'])
+ >>> cmd.run(bd, args=['none', '/a'])
>>> bd.flush_reload()
>>> bd.bug_from_uuid('a').assigned is None
True
@@ -75,7 +75,15 @@ class Assign (libbe.command.Command):
elif assignee == '-':
assignee = params['user-id']
for bug_id in params['bug-id']:
- bug = bugdir.bug_from_uuid(bug_id)
+ p = libbe.util.id.parse_user(bugdir, bug_id)
+ if p['type'] != 'bug':
+ raise libbe.command.UserError(
+ '%s is a %s id, not a bug id' % (bug_id, p['type']))
+ if p['bugdir'] != bugdir.uuid:
+ raise libbe.command.UserError(
+ "%s doesn't belong to this bugdir (%s)"
+ % (bug_id, bugdir.uuid))
+ bug = bugdir.bug_from_uuid(p['bug'])
if bug.assigned != assignee:
bug.assigned = assignee