[IMP] runbot: always display autorebase for external pr

This commit is contained in:
Xavier-Do 2024-04-02 11:31:05 +02:00
parent 70532df2d6
commit 4f0094ea70
2 changed files with 2 additions and 2 deletions

View File

@ -224,7 +224,7 @@ class Runbot(Controller):
'/runbot/bundle/<model("runbot.bundle"):bundle>/force/<int:auto_rebase>',
], type='http', auth="user", methods=['GET', 'POST'], csrf=False)
def force_bundle(self, bundle, auto_rebase=False, **_post):
if not request.env.user.has_group('runbot.group_runbot_advanced_user'):
if not request.env.user.has_group('runbot.group_runbot_advanced_user') and ':' not in bundle.name:
raise Forbidden("Only users with a specific group can do that. Please contact runbot administrators")
_logger.info('user %s forcing bundle %s', request.env.user.name, bundle.name) # user must be able to read bundle
batch = bundle.sudo()._force()

View File

@ -17,7 +17,7 @@
<a groups="runbot.group_runbot_advanced_user" class="btn btn-default" t-attf-href="/runbot/bundle/{{bundle.id}}/force" title="Force A New Batch">
<i class="fa fa-refresh"/>
</a>
<a groups="runbot.group_runbot_advanced_user" class="btn btn-default" t-attf-href="/runbot/bundle/{{bundle.id}}/force/1" title="Force A New Batch with automatic rebase">
<a t-if="bundle.env.user.has_group('runbot.group_runbot_advanced_user') or (bundle.env.user.has_group('runbot.group_user') and ':' in bundle.name)" class="btn btn-default" t-attf-href="/runbot/bundle/{{bundle.id}}/force/1" title="Force A New Batch with automatic rebase">
<i class="fa fa-fast-forward"/>
</a>
<t t-call="runbot.branch_copy_button"/>