From 1535fc0565225b28533dc457e9766add50b68a31 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 11 Nov 2021 23:55:34 +0100 Subject: [PATCH] refactor is_package --- InvenTree/plugin/integration.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/InvenTree/plugin/integration.py b/InvenTree/plugin/integration.py index b5b84b6ed0..1b8b70e3bd 100644 --- a/InvenTree/plugin/integration.py +++ b/InvenTree/plugin/integration.py @@ -282,6 +282,10 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin): self.set_package() + @property + def _is_package(self): + return getattr(self, 'is_package', False) + # properties @property def slug(self): @@ -356,7 +360,7 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin): def set_package(self): """add packaging info of the plugins into plugins context""" - package = self.get_package_metadata() if getattr(self, 'is_package', False) else self.get_package_commit() + package = self.get_package_metadata() if self._is_package else self.get_package_commit() # process date if package.get('date'):