diff --git a/InvenTree/plugins/integration/integration.py b/InvenTree/plugins/integration/integration.py index afb860b31e..abb9e7b0e3 100644 --- a/InvenTree/plugins/integration/integration.py +++ b/InvenTree/plugins/integration/integration.py @@ -179,8 +179,6 @@ class IntegrationPlugin(MixinBase, plugin.InvenTreePlugin): def __init__(self): self.add_mixin('base') - self.commit = self.get_plugin_commit() - self.sign_state = 0 self.set_sign_values() def mixin(self, key): @@ -197,11 +195,18 @@ class IntegrationPlugin(MixinBase, plugin.InvenTreePlugin): return get_git_log(path) def set_sign_values(self): - if self.sign_state == 0: + # fetch git log + commit = self.get_plugin_commit() + # resolve state + sign_state = getattr(GitStatus, commit['verified'], GitStatus.E) + + # set variables + self.commit = commit + self.sign_state = sign_state + + if sign_state.status == 0: self.sign_color = 'success' - - elif self.sign_state == 1: + elif sign_state.status == 1: self.sign_color = 'warning' - else: self.sign_color = 'danger'