sachet/server/files/views.py: fix db integrity error

i'll be honest i have no idea what just happened
This commit is contained in:
dogeystamp 2023-05-20 23:06:01 -04:00
parent cbf1310e1b
commit a8f22fb741
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -111,9 +111,7 @@ class FileContentAPI(MethodView):
if upload.completed:
share.initialized = True
# really convoluted
# but otherwise it doesn't cascade deletes?
Upload.query.filter(Upload.upload_id == upload.upload_id).delete()
db.session.delete(upload)
db.session.commit()
return jsonify(dict(status="success", message="Upload completed.")), 201
else: