diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index 0340792101..08326d6f25 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -1616,13 +1616,6 @@ class InvenTreeSetting(BaseInvenTreeSetting): 'requires_restart': True, }, - 'PLUGIN_CHECK_SIGNATURES': { - 'name': _('Check plugin signatures'), - 'description': _('Check and show signatures for plugins'), - 'default': False, - 'validator': bool, - }, - # Settings for plugin mixin features 'ENABLE_PLUGINS_URL': { 'name': _('Enable URL integration'), diff --git a/InvenTree/plugin/helpers.py b/InvenTree/plugin/helpers.py index 5277fc78de..d616273d74 100644 --- a/InvenTree/plugin/helpers.py +++ b/InvenTree/plugin/helpers.py @@ -128,42 +128,14 @@ def get_git_log(path): commit.author.decode().split('<')[1][:-1], datetime.datetime.fromtimestamp(commit.author_time, ).isoformat(), commit.message.decode().split('\n')[0], - 'E', - None ] except NotGitRepository: pass if not output: - output = 7 * [''] # pragma: no cover + output = 5 * [''] # pragma: no cover - return {'hash': output[0], 'author': output[1], 'mail': output[2], 'date': output[3], 'message': output[4], 'verified': output[5], 'key': output[6]} - - -class GitStatus: - """Class for resolving git gpg singing state.""" - - class Definition: - """Definition of a git gpg sing state.""" - - key: str = 'N' - status: int = 2 - msg: str = '' - - def __init__(self, key: str = 'N', status: int = 2, msg: str = '') -> None: - """Define a git Status -> needed for lookup.""" - self.key = key - self.status = status - self.msg = msg - - N = Definition(key='N', status=2, msg='no signature',) - G = Definition(key='G', status=0, msg='valid signature',) - B = Definition(key='B', status=2, msg='bad signature',) - U = Definition(key='U', status=1, msg='good signature, unknown validity',) - X = Definition(key='X', status=1, msg='good signature, expired',) - Y = Definition(key='Y', status=1, msg='good signature, expired key',) - R = Definition(key='R', status=2, msg='good signature, revoked key',) - E = Definition(key='E', status=1, msg='cannot be checked',) + return {'hash': output[0], 'author': output[1], 'mail': output[2], 'date': output[3], 'message': output[4]} # endregion diff --git a/InvenTree/plugin/plugin.py b/InvenTree/plugin/plugin.py index 8d19c1c80e..4b2d2886cd 100644 --- a/InvenTree/plugin/plugin.py +++ b/InvenTree/plugin/plugin.py @@ -14,7 +14,7 @@ from django.urls.base import reverse from django.utils.text import slugify from django.utils.translation import gettext_lazy as _ -from plugin.helpers import GitStatus, get_git_log +from plugin.helpers import get_git_log logger = logging.getLogger("inventree") @@ -394,16 +394,6 @@ class InvenTreePlugin(VersionMixin, MixinBase, MetaBase): if package.get('date'): package['date'] = datetime.fromisoformat(package.get('date')) - # process sign state - sign_state = getattr(GitStatus, str(package.get('verified')), GitStatus.N) - if sign_state.status == 0: - self.sign_color = 'success' # pragma: no cover - elif sign_state.status == 1: - self.sign_color = 'warning' - else: - self.sign_color = 'danger' # pragma: no cover - # set variables self.package = package - self.sign_state = sign_state # endregion diff --git a/InvenTree/templates/InvenTree/settings/plugin.html b/InvenTree/templates/InvenTree/settings/plugin.html index 190f7697f1..3813264176 100644 --- a/InvenTree/templates/InvenTree/settings/plugin.html +++ b/InvenTree/templates/InvenTree/settings/plugin.html @@ -24,8 +24,6 @@ {% include "InvenTree/settings/setting.html" with key="ENABLE_PLUGINS_NAVIGATION" icon="fa-sitemap" %} {% include "InvenTree/settings/setting.html" with key="ENABLE_PLUGINS_APP" icon="fa-rocket" %} {% include "InvenTree/settings/setting.html" with key="PLUGIN_ON_STARTUP" %} - - {% include "InvenTree/settings/setting.html" with key="PLUGIN_CHECK_SIGNATURES" %} diff --git a/InvenTree/templates/InvenTree/settings/plugin_settings.html b/InvenTree/templates/InvenTree/settings/plugin_settings.html index d83b408867..21646a298e 100644 --- a/InvenTree/templates/InvenTree/settings/plugin_settings.html +++ b/InvenTree/templates/InvenTree/settings/plugin_settings.html @@ -118,20 +118,6 @@ {% trans "Commit Message" %}{{ plugin.package.message }}{% include "clip.html" %} {% endif %} - - {% settings_value "PLUGIN_CHECK_SIGNATURES" as signatures %} - {% if signatures %} - - - {% trans "Sign Status" %} - {% if plugin.package.verified %}{{ plugin.package.verified }}: {% endif %}{{ plugin.sign_state.msg }} - - - - {% trans "Sign Key" %} - {{ plugin.package.key }}{% include "clip.html" %} - - {% endif %}