diff options
author | Trevor Bramwell <tbramwell@linuxfoundation.org> | 2018-11-07 22:05:28 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-11-07 22:05:28 +0000 |
commit | 6a90796de1df8d74c79415c39c867ffe6cd80fd0 (patch) | |
tree | e192b4149cb535da0a8b928be65f2529a250b5ca /src/api/models.py | |
parent | c589b15fbf1b5f386d0d6af453d2388e1a0ee1ad (diff) | |
parent | 7b15aed77c6675286fd75b8832af58c992717ef9 (diff) |
Merge "Rewrite Notification subsystem"
Diffstat (limited to 'src/api/models.py')
-rw-r--r-- | src/api/models.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/api/models.py b/src/api/models.py index 9afc89a..4237559 100644 --- a/src/api/models.py +++ b/src/api/models.py @@ -217,6 +217,18 @@ class Job(models.Model): tasklist += list(cls.objects.filter(job=self).filter(status=status)) return tasklist + def is_fulfilled(self): + """ + This method should return true if all of the job's tasks are done, + and false otherwise + """ + my_tasks = self.get_tasklist() + for task in my_tasks: + if task.status != JobStatus.DONE: + return False + return True + + def get_delta(self, status): d = {} j = {} |