Example #1
0
 def delete(self):
     """POST /photos/delete: Create a new item"""
     uri = self.request.params.get("uri", None)
     if not uri:
         return HTTPBadRequest()
     if DBSession.query(Photo).filter_by(uri=uri).delete() == 0:
         raise NotFound()
     ip.remove_image(uri)
     log.debug("ip.remove_image(%s)" % uri)
     return True
Example #2
0
def before_photo_delete(context, event):
    ip.remove_image(context.uri)
    log.debug('ip.remove_image(%s)' % context.uri)