@autocommit decorator should not shadow exceptions caused by controller methods
avoid duplicate database commit when deleting a media