mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
chore: format
This commit is contained in:
@@ -71,8 +71,9 @@ def override_static(path: str, content: str):
|
||||
def get_license_data(app, key):
|
||||
if key:
|
||||
try:
|
||||
# https://api.openwebui.com
|
||||
res = requests.post(
|
||||
"https://api.openwebui.com/api/v1/license",
|
||||
"http://localhost:5555/api/v1/license",
|
||||
json={"key": key, "version": "1"},
|
||||
timeout=5,
|
||||
)
|
||||
@@ -83,11 +84,12 @@ def get_license_data(app, key):
|
||||
if k == "resources":
|
||||
for p, c in v.items():
|
||||
globals().get("override_static", lambda a, b: None)(p, c)
|
||||
elif k == "user_count":
|
||||
elif k == "count":
|
||||
setattr(app.state, "USER_COUNT", v)
|
||||
elif k == "webui_name":
|
||||
elif k == "name":
|
||||
setattr(app.state, "WEBUI_NAME", v)
|
||||
|
||||
elif k == "info":
|
||||
setattr(app.state, "LICENSE_INFO", v)
|
||||
return True
|
||||
else:
|
||||
log.error(
|
||||
|
||||
Reference in New Issue
Block a user