From e889f487f010be2b59a0961e051ce93e54db40de Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 9 Jan 2022 22:27:50 +0100 Subject: [PATCH] added a check for the required constants --- InvenTree/plugin/builtin/integration/mixins.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/InvenTree/plugin/builtin/integration/mixins.py b/InvenTree/plugin/builtin/integration/mixins.py index 66676d0520..7d257dbee5 100644 --- a/InvenTree/plugin/builtin/integration/mixins.py +++ b/InvenTree/plugin/builtin/integration/mixins.py @@ -368,7 +368,10 @@ class APICallMixin: @property def has_api_call(self): """Is the mixin ready to call external APIs?""" - # TODO check if settings are set + if not bool(self.API_URL_SETTING): + raise ValueError("API_URL_SETTING must be defined") + if not bool(self.API_TOKEN_SETTING): + raise ValueError("API_TOKEN_SETTING must be defined") return True @property