mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[IMP] runbot_merge: only label PR if not created merged/closed
Would generate a ton of GH API churn when synchronising.
This commit is contained in:
parent
39a0d723af
commit
47428a4580
@ -559,12 +559,13 @@ class PullRequests(models.Model):
|
|||||||
@api.model
|
@api.model
|
||||||
def create(self, vals):
|
def create(self, vals):
|
||||||
pr = super().create(vals)
|
pr = super().create(vals)
|
||||||
self.env['runbot_merge.pull_requests.tagging'].create({
|
if pr.state not in ('closed', 'merged'):
|
||||||
'pull_request': pr.number,
|
self.env['runbot_merge.pull_requests.tagging'].create({
|
||||||
'repository': pr.repository.id,
|
'pull_request': pr.number,
|
||||||
'state_from': False,
|
'repository': pr.repository.id,
|
||||||
'state_to': pr._tagstate,
|
'state_from': False,
|
||||||
})
|
'state_to': pr._tagstate,
|
||||||
|
})
|
||||||
return pr
|
return pr
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
|
Loading…
Reference in New Issue
Block a user