Fixed /rest/media endpoint DELETE

This commit is contained in:
Albert Santoni 2015-03-03 12:52:41 -05:00
parent 0144fd2a84
commit 8a6ee8ad14
1 changed files with 2 additions and 4 deletions

View File

@ -280,10 +280,8 @@ class CcFiles extends BaseCcFiles {
$file = CcFilesQuery::create()->findPk($id);
if ($file) {
$con = Propel::getConnection();
$storedFile = new Application_Model_StoredFile($file, $con);
if ($storedFile->existsOnDisk()) {
$storedFile->delete(); //TODO: This checks your session permissions... Make it work without a session?
}
$storedFile = Application_Model_StoredFile::RecallById($id, $con);
$storedFile->delete();
} else {
throw new FileNotFoundException();
}