[FIX] runbot_merge: only update pending staging state

The staging validation routine would ignore stagings which were
cancelled or ff_failed, but it should also have ignored failed and
successful aka all terminal state.

Simplify the condition for that: just ignore a staging's validation if
the staging is not pending.

Closes #211
This commit is contained in:
Xavier Morel 2019-09-27 14:59:37 +02:00 committed by xmo-odoo
parent cd29c648e8
commit e49b112447

View File

@ -1311,7 +1311,7 @@ class Stagings(models.Model):
('pending', 'Pending'),
('cancelled', "Cancelled"),
('ff_failed', "Fast forward failed")
])
], default='pending')
active = fields.Boolean(default=True)
staged_at = fields.Datetime(default=fields.Datetime.now)
@ -1362,7 +1362,7 @@ class Stagings(models.Model):
def _validate(self):
Commits = self.env['runbot_merge.commit']
for s in self:
if s.state in ('cancelled', 'ff_failed'):
if s.state != 'pending':
continue
heads = [