diff --git a/application/src/tira_app/authentication.py b/application/src/tira_app/authentication.py index e712529c..c52427a6 100644 --- a/application/src/tira_app/authentication.py +++ b/application/src/tira_app/authentication.py @@ -342,6 +342,12 @@ def create_docker_group(self, team_name, user_name): group_id = self.discourse_client.create_group(f"tira_vm_{slugify(team_name)}", group_bio, 0) model.get_vm(team_name, create_if_none=True) self.discourse_client.add_user_as_owner_to_group(group_id, user_name) + invite_link = self.discourse_client.create_invite_link(group_id) + return { + "group_id": group_id, + "invite_link": invite_link, + "group_link": f"https://www.tira.io/g/tira_vm_{slugify(team_name)}", + } def user_is_organizer_for_endpoint( self, diff --git a/application/src/tira_app/endpoints/data_api.py b/application/src/tira_app/endpoints/data_api.py index a68bd4cb..8cf361d9 100644 --- a/application/src/tira_app/endpoints/data_api.py +++ b/application/src/tira_app/endpoints/data_api.py @@ -473,7 +473,7 @@ def add_registration(request, context, task_id, vm_id): data["task_id"] = task_id model.add_registration(data) - auth.create_docker_group(data["group"], data["initial_owner"]) + context["created_group"] = auth.create_docker_group(data["group"], data["initial_owner"]) auth.notify_organizers_of_new_participants(data, task_id) context["user_is_registered"] = True