Skip to content

Commit 65a1184

Browse files
Return discourse url regardless of client integration status
1 parent 21a464d commit 65a1184

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

appstore/discourse.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
if config['DISCOURSE_API_KEY'] is None:
1818
_client = None
19+
print("== Discourse Integration not configured.")
1920
else:
2021
_client = DiscourseClient(host=f"https://{config['DISCOURSE_HOST']}", api_username=config['DISCOURSE_USER'], api_key=config['DISCOURSE_API_KEY'])
2122

@@ -116,6 +117,7 @@ def announce_new_app(app, is_generated):
116117
""")
117118

118119
def get_topic_url_for_app(app):
119-
if not _client or not app.discourse_topic_id or app.discourse_topic_id == -1:
120-
return None
121-
return f"https://{config['DISCOURSE_HOST']}/t/{app.discourse_topic_id}"
120+
if app.discourse_topic_id > 0:
121+
return f"https://{config['DISCOURSE_HOST']}/t/{app.discourse_topic_id}"
122+
else:
123+
return

0 commit comments

Comments
 (0)