Skip to content

Commit

Permalink
revisions: Handle updating the test state when deleting a result
Browse files Browse the repository at this point in the history
While we don't have an API to delete a test result at the moment, it's
future proof to fix this straight away. That means we can also use it
when tinkering with the db from manage.py shell for instance.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
  • Loading branch information
Damien Lespiau committed May 3, 2016
1 parent 0023064 commit a64761c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions patchwork/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,10 @@ def refresh_test_state(self):
results = TestResult.objects.filter(revision=self)
if results.count() > 0:
self.test_state = max([r.state for r in results])
self.save()
self.series.save()
else:
self.test_state = None
self.save()
self.series.save()

def human_name(self):
name = self.series.name
Expand Down

0 comments on commit a64761c

Please sign in to comment.