diff --git a/runbot/models/branch.py b/runbot/models/branch.py index 7ad4db4e..66205ea8 100644 --- a/runbot/models/branch.py +++ b/runbot/models/branch.py @@ -113,11 +113,11 @@ class Branch(models.Model): pi = branch.is_pr and (pull_info or pull_info_dict.get((branch.remote_id, branch.name)) or branch._get_pull_info()) if pi: try: - branch.draft = pi.get('draft', False) branch.alive = pi.get('state', False) != 'closed' branch.target_branch_name = pi['base']['ref'] branch.pull_head_name = pi['head']['label'] branch.pr_title = pi['title'] + branch.draft = pi.get('draft', False) or branch.pr_title and (branch.pr_title.startswith('[DRAFT]') or branch.pr_title.startswith('[WIP]')) branch.pr_body = pi['body'] branch.pr_author = pi['user']['login'] pull_head_repo_name = False diff --git a/runbot/templates/branch.xml b/runbot/templates/branch.xml index e01809c9..34f32fc1 100644 --- a/runbot/templates/branch.xml +++ b/runbot/templates/branch.xml @@ -45,6 +45,10 @@