diff --git a/extensions/users.py b/extensions/users.py index ed3c05b..393be62 100644 --- a/extensions/users.py +++ b/extensions/users.py @@ -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} ) \ No newline at end of file + col_albums.delete_many( {"user": current_user.user} ) + return Response(status_code=HTTP_204_NO_CONTENT) \ No newline at end of file