From 832611434405f4efae05d16f15ab9f7b88ae810c Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 21 Jan 2018 13:48:29 +0200 Subject: Fix: retain next_build_id when project is updated --- ick2/projectapi.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ick2/projectapi.py') diff --git a/ick2/projectapi.py b/ick2/projectapi.py index ffa1f1b..9548c38 100644 --- a/ick2/projectapi.py +++ b/ick2/projectapi.py @@ -22,12 +22,17 @@ class ProjectAPI(ick2.ResourceApiBase): super().__init__('projects', state) self._pi = ick2.PipelineInstances(self.get_state()) - def mangle_resource(self, resource): + def mangle_new_resource(self, resource): new = dict(resource) if 'next_build_id' not in new: new['next_build_id'] = None return new + def mangle_updated_resource(self, old, new): + new = dict(new) + new['next_build_id'] = old.get('next_build_id') + return new + def get_resource_name(self, resource): return resource['project'] -- cgit v1.2.1