user_delete accepts x-www-form-urlencoded now
This commit is contained in:
parent
19b1ae6158
commit
906674fcdb
@ -6,7 +6,7 @@ from modules.scheduler import scheduler
|
||||
from modules.mailer import mail_sender
|
||||
|
||||
from uuid import uuid1
|
||||
from fastapi import Depends, HTTPException
|
||||
from fastapi import Depends, HTTPException, Form
|
||||
from fastapi.responses import Response, UJSONResponse
|
||||
from starlette.status import HTTP_204_NO_CONTENT, HTTP_400_BAD_REQUEST, HTTP_406_NOT_ACCEPTABLE
|
||||
|
||||
@ -60,7 +60,7 @@ if configGet("registration_enabled") is True:
|
||||
|
||||
|
||||
@app.delete("/users/me/")
|
||||
async def user_delete(password: str, current_user: User = Depends(get_current_active_user)):
|
||||
async def user_delete(password: str = Form(), current_user: User = Depends(get_current_active_user)):
|
||||
user = get_user(current_user.user)
|
||||
if not user:
|
||||
return False
|
||||
@ -70,4 +70,5 @@ async def user_delete(password: str, current_user: User = Depends(get_current_ac
|
||||
col_emails.delete_many( {"user": current_user.user} )
|
||||
col_photos.delete_many( {"user": current_user.user} )
|
||||
col_videos.delete_many( {"user": current_user.user} )
|
||||
col_albums.delete_many( {"user": current_user.user} )
|
||||
col_albums.delete_many( {"user": current_user.user} )
|
||||
return Response(status_code=HTTP_204_NO_CONTENT)
|
Loading…
Reference in New Issue
Block a user