From 2e3616c2a204e33e66f91bcd5c0d9a0fb35c2a6f Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 25 Nov 2021 12:00:56 +0100 Subject: [PATCH] take: assign to self by default if issue is new and has no currently assigned person --- git_redmine.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git_redmine.py b/git_redmine.py index 4590f3c..914631d 100644 --- a/git_redmine.py +++ b/git_redmine.py @@ -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: