fix(admin): fix import user with csv with no group assigned

darta 2022-02-06 19:29:24 +01:00
parent 304d8e8724
commit cc8bdc8554
1 changed files with 12 additions and 11 deletions

View File

@ -584,8 +584,8 @@ class Admin:
+ ") uploaded user: "
+ u["username"]
)
user_groups = [g.strip() for g in u["groups"].split(",")]
user_groups = [g.strip() for g in u["groups"].split(",") if g !=""]
if not len(user_groups): user_groups = ["/"+u["role"].strip()]
pathslist = []
for group in user_groups:
pathpart = ""
@ -637,6 +637,7 @@ class Admin:
groups = list(dict.fromkeys(groups))
sysgroups = []
for g in groups:
if g != "":
sysgroups.append(
{
"provider": "external",