Skip to content

Commit

Permalink
fix: Discourse service check now checks API key before creating a ser…
Browse files Browse the repository at this point in the history
…vice (#544)

Co-authored-by: Alan Christie <[email protected]>
  • Loading branch information
alanbchristie and Alan Christie authored Feb 29, 2024
1 parent 4f3e1f2 commit c130a12
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions viewer/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ def discourse(func_id, name, key=None, url=None, user=None) -> bool:
del func_id, name

logger.debug("+ discourse")
# Discourse is "unconfigured" if there is no API key
if not settings.DISCOURSE_API_KEY:
return False
client = DiscourseClient(
os.environ.get(url, None),
api_username=os.environ.get(user, None),
Expand Down Expand Up @@ -206,6 +209,7 @@ def keycloak(func_id, name, url=None, secret=None) -> bool:
del func_id, name, secret

logger.debug("+ keycloak")
# Keycloak is "unconfigured" if there is no realm URL
keycloak_realm = os.environ.get(url, None)
if not keycloak_realm:
return False
Expand Down

0 comments on commit c130a12

Please sign in to comment.