(fix) install python-multipart if missing

This commit is contained in:
ishaan-jaff 2024-01-30 18:19:49 -08:00
parent 9780589173
commit 069976daed

View file

@ -2972,6 +2972,11 @@ async def google_login(request: Request):
"/login", include_in_schema=False "/login", include_in_schema=False
) # hidden since this is a helper for UI sso login ) # hidden since this is a helper for UI sso login
async def login(request: Request): async def login(request: Request):
try:
import multipart
except ImportError:
subprocess.run(["pip", "install", "python-multipart"])
form = await request.form() form = await request.form()
username = str(form.get("username")) username = str(form.get("username"))
password = form.get("password") password = form.get("password")