mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-09 03:18:18 +00:00
refac
This commit is contained in:
parent
0842acad53
commit
16335f866e
1 changed files with 8 additions and 2 deletions
|
|
@ -143,8 +143,14 @@ def get_license_data(app, key):
|
|||
pn, pt = nt(pb)
|
||||
|
||||
data = json.loads(aesgcm.decrypt(pn, pt, None).decode())
|
||||
if not data.get('exp') or data.get('exp') < datetime.now().date():
|
||||
return False
|
||||
|
||||
exp = data.get('exp')
|
||||
if exp:
|
||||
if isinstance(exp, str):
|
||||
from datetime import date
|
||||
exp = date.fromisoformat(exp)
|
||||
if exp < datetime.now().date():
|
||||
return False
|
||||
|
||||
data_handler(data)
|
||||
return True
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue