take: assign to self by default if issue is new and has no currently assigned person

This commit is contained in:
Benjamin Dauvergne 2021-11-25 12:00:56 +01:00
parent e7a55c9ff5
commit 2e3616c2a2
1 changed files with 2 additions and 1 deletions

View File

@ -222,7 +222,8 @@ def take(issue_number, reference):
click.echo('Moved to branch %s' % branch_name)
current_user = api.user.get('current')
if ((not hasattr(issue, 'assigned_to') or issue.assigned_to.id != current_user.id)
and click.confirm('Do you want to assign the issue to yourself ?', default=not hasattr(issue,·'assigned_to'))):
and click.confirm('Do you want to assign the issue to yourself ?',
default=not hasattr(issue, 'assigned_to') and issue.status == api.nouveau)):
issue.assigned_to_id = current_user.id
issue.save()
if new: