mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[GH-ISSUE #22856] Bug: TypeError in get_license_data() when LICENSE_BLOB has missing/None exp field #123139
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @themavik on GitHub (Mar 19, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22856
Bug Description
In
backend/open_webui/utils/auth.py, theget_license_data()function has a logic error in the license expiration check that causes aTypeErrorwhen theexpfield is missing orNone.Code Location
backend/open_webui/utils/auth.py:Problem
The condition uses
andinstead ofor. Whenexpis missing orNone:not data.get("exp")evaluates toTrue(sinceNoneis falsy)and, Python evaluates the second condition:None < datetime.now().date()TypeError: '<\ not supported between instances of 'NoneType' and 'datetime.date'Reproduction
Suggested Fix
This correctly returns
Falsewhenexpis missing (treat as expired) OR whenexpis in the past.Environment