Skip to content

Commit 87d33f6

Browse files
committed
refac
1 parent fd91fa4 commit 87d33f6

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

backend/open_webui/config.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,17 +1299,6 @@ def reachable(host: str, port: int) -> bool:
12991299
os.environ.get("DEFAULT_GROUP_ID", ""),
13001300
)
13011301

1302-
# Controls the default "Who can share to this group" setting for new groups.
1303-
# Env var values: "true" (anyone), "false" (no one), "members" (only group members).
1304-
_default_group_share = os.environ.get(
1305-
"DEFAULT_GROUP_SHARE_PERMISSION", "members"
1306-
).strip().lower()
1307-
DEFAULT_GROUP_SHARE_PERMISSION = (
1308-
"members"
1309-
if _default_group_share == "members"
1310-
else _default_group_share == "true"
1311-
)
1312-
13131302
PENDING_USER_OVERLAY_TITLE = PersistentConfig(
13141303
"PENDING_USER_OVERLAY_TITLE",
13151304
"ui.pending_user_overlay_title",

backend/open_webui/env.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,3 +1041,18 @@ def parse_section(section):
10411041
####################################
10421042

10431043
EXTERNAL_PWA_MANIFEST_URL = os.environ.get("EXTERNAL_PWA_MANIFEST_URL")
1044+
1045+
####################################
1046+
# GROUP DEFAULTS
1047+
####################################
1048+
1049+
# Controls the default "Who can share to this group" setting for new groups.
1050+
# Env var values: "true" (anyone), "false" (no one), "members" (only group members).
1051+
_default_group_share = os.environ.get(
1052+
"DEFAULT_GROUP_SHARE_PERMISSION", "members"
1053+
).strip().lower()
1054+
DEFAULT_GROUP_SHARE_PERMISSION = (
1055+
"members"
1056+
if _default_group_share == "members"
1057+
else _default_group_share == "true"
1058+
)

backend/open_webui/models/groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from sqlalchemy.orm import Session
88
from open_webui.internal.db import Base, JSONField, get_db, get_db_context
9-
from open_webui.config import DEFAULT_GROUP_SHARE_PERMISSION
9+
from open_webui.env import DEFAULT_GROUP_SHARE_PERMISSION
1010

1111
from open_webui.models.files import FileMetadataResponse
1212

0 commit comments

Comments
 (0)