Add Discourse users to Protospace Members group on auth

This commit is contained in:
Tanner Collin 2021-10-07 06:39:04 +00:00
parent 3a91f14b29
commit 0b25fa173b

View File

@ -744,6 +744,9 @@ class SpaceportAuthSerializer(LoginSerializer):
data['username'] = user.member.discourse_username or user.username
utils_auth.set_discourse_password(data)
if not user.member.paused_date:
utils_auth.add_discourse_group_members('protospace_members', [data['username']])
if not user.member.discourse_username:
user.member.discourse_username = user.username
user.member.save()