'Delete a Project\'s Release
Permanently remove a release and all of its files.
: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
release of.
:pparam string version: the version identifier of the release.
:auth: required'

def delete(self, request, project, version):

    try:
        release = Release.objects.get(organization_id=project.organization_id, projects=project, version=version)
    except Release.DoesNotExist:
        raise ResourceDoesNotExist
    if Group.objects.filter(first_release=release).exists():
        return Response({'detail': ERR_RELEASE_REFERENCED}, status=400)
    file_list = ReleaseFile.objects.filter(release=release).select_related('file')
    for releasefile in file_list:
        releasefile.file.delete()
        releasefile.delete()
    release.delete()
    return Response(status=204)
