From 0eb8f5f549f0ea352857e825d838c2965f4901ad Mon Sep 17 00:00:00 2001 From: Evilham Date: Thu, 4 Aug 2022 09:24:37 +0200 Subject: [PATCH] [sso-admin] Fix issue when editing users Co-written with: @elena61 --- dd-sso/admin/src/admin/lib/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dd-sso/admin/src/admin/lib/admin.py b/dd-sso/admin/src/admin/lib/admin.py index aab2fa3..4d3de22 100644 --- a/dd-sso/admin/src/admin/lib/admin.py +++ b/dd-sso/admin/src/admin/lib/admin.py @@ -1618,7 +1618,7 @@ class Admin: internaluser : DDUser = [u for u in self.internal["users"] if u["id"] == user_id][0] cohorts = self.moodle.get_cohorts() for group in mdelete: - cohort = [c for c in cohorts if c["name"] == group[0]][0] + cohort = [c for c in cohorts if c["name"] == group][0] try: self.moodle.delete_user_in_cohort( internaluser["moodle_id"], cohort["id"] @@ -1908,7 +1908,7 @@ class Admin: " NEXTCLOUD USERS: Creating nextcloud user: " + u["username"] + " in groups " - + str(list) + + str(u.get("groups", [])) ) try: # Quota is in MB