added a check for the required constants

This commit is contained in:
Matthias 2022-01-09 22:27:50 +01:00
parent 31d587a9b1
commit e889f487f0
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -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