Преглед на файлове

fix: exclude empty roles

This is a minor tweak that allows using whitespace as a separator,
without it having to be exactly one space. Convenient for using YAML
text fold syntax in Helm charts when providing long lists of roles.
Attila Oláh преди 3 месеца
родител
ревизия
c165a6b6c2
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      backend/open_webui/config.py

+ 2 - 1
backend/open_webui/config.py

@@ -584,13 +584,14 @@ OAUTH_ALLOWED_ROLES = PersistentConfig(
     [
         role.strip()
         for role in os.environ.get("OAUTH_ALLOWED_ROLES", f"user{SEP}admin").split(SEP)
+        if role
     ],
 )
 
 OAUTH_ADMIN_ROLES = PersistentConfig(
     "OAUTH_ADMIN_ROLES",
     "oauth.admin_roles",
-    [role.strip() for role in os.environ.get("OAUTH_ADMIN_ROLES", "admin").split(SEP)],
+    [role.strip() for role in os.environ.get("OAUTH_ADMIN_ROLES", "admin").split(SEP) if role],
 )
 
 OAUTH_ALLOWED_DOMAINS = PersistentConfig(