Updated the code to create the Students/Teachers group if it does not exist yet
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user