mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-30 17:25:30 -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
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