mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	refactor of sign state set function
This commit is contained in:
		| @@ -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' | ||||
|   | ||||
		Reference in New Issue
	
	Block a user