From 3dd606b0af3ac7896bb7dc0662357b52efaacc16 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 25 Sep 2021 23:00:16 +0000 Subject: [PATCH] Add new users to protospace_members Discourse group --- apiserver/apiserver/api/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apiserver/apiserver/api/utils.py b/apiserver/apiserver/api/utils.py index 71da823..1a42bc8 100644 --- a/apiserver/apiserver/api/utils.py +++ b/apiserver/apiserver/api/utils.py @@ -415,6 +415,13 @@ def register_user(data, user): utils.alert_tanner(msg) logger.info(msg) + if utils_auth.discourse_is_configured(): + if data['request_id']: utils_stats.set_progress(data['request_id'], 'Adding to Discourse group...') + if utils_auth.add_discourse_group_members('protospace_members', [data['username']]) != 200: + msg = 'Problem connecting to Discourse Auth server: add.' + utils.alert_tanner(msg) + logger.info(msg) + if data['request_id']: utils_stats.set_progress(data['request_id'], 'Done!') time.sleep(1)