'Delete a File
Permanently remove a file from a release.
This will also remove the physical file from storage.
:pparam string organization_slug: the slug of the organization the
release belongs to.
:pparam string project_slug: the slug of the project to delete the
file of.
:pparam string version: the version identifier of the release.
:pparam string file_id: the ID of the file to delete.
:auth: required'

@attach_scenarios([delete_file_scenario])
def delete(self, request, project, version, file_id):

    try:
        release = Release.objects.get(organization_id=project.organization_id, projects=project, version=version)
    except Release.DoesNotExist:
        raise ResourceDoesNotExist
    try:
        releasefile = ReleaseFile.objects.get(release=release, id=file_id)
    except ReleaseFile.DoesNotExist:
        raise ResourceDoesNotExist
    file = releasefile.file
    releasefile.delete()
    file.delete()
    return Response(status=204)
