Skip to content

Commit

Permalink
Full delete removes image from disk
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks committed Feb 14, 2019
1 parent fa1ea6a commit 06c8c8d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/api/undo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from flask_restplus import Namespace, Resource, reqparse
from flask_login import login_required, current_user

import os
import datetime
from ..models import *

Expand Down Expand Up @@ -100,6 +101,9 @@ def delete(self):
if model_object is None:
return {"message": "Invalid id"}, 400

if isinstance(model_object, ImageModel):
os.remove(model_object.path)

model_object.delete()

return {"success": True}
Expand Down

0 comments on commit 06c8c8d

Please sign in to comment.