Updated the code to create the Students/Teachers group if it does not exist yet

This commit is contained in:
Tiago Ribeiro
2024-09-05 10:56:58 +01:00
parent f0f904f2e4
commit a88d6bb568

View File

@@ -223,6 +223,17 @@ class BatchUsers:
if user_id not in participants:
participants.append(user_id)
group.reference.update({'participants': participants})
else:
group = {
'admin': corporate_user.id,
'id': str(uuid.uuid4()),
'name': group_type,
'participants': [user_id],
'disableEditing': True,
}
self._db.collection('groups').document(group['id']).set(group)
def _assign_user_to_group_by_name(self, user: UserDTO, maker_id: str):
user_id = str(user.id)