@login_required
def project_version_delete_html(request, project_slug, version_slug):
 project = get_object_or_404(Project.objects.for_admin_user(request.user), slug=project_slug)
 version = get_object_or_404(Version.objects.public(user=request.user, project=project, only_active=False), slug=version_slug)
 if (not version.active):
  version.built = False
  version.save()
  broadcast(type='app', task=tasks.clear_artifacts, args=[version.pk])
 else:
  return HttpResponseBadRequest("Can't delete HTML for an active version.")
 return HttpResponseRedirect(reverse('project_version_list', kwargs={'project_slug': project_slug}))

@ login_required def project_version_delete_html ( request , project_slug , version_slug ) : project = get_object_or_404 ( Project . objects . for_admin_user ( request . user ) , slug = project_slug ) version = get_object_or_404 ( Version . objects . public ( user = request . user , project = project , only_active = False ) , slug = version_slug ) if ( not version . active ) : version . built = False version . save ( ) broadcast ( type = 'app' , task = tasks . clear_artifacts , args = [ version . pk ] ) else : return HttpResponseBadRequest ( "Can't delete HTML for an active version." ) return HttpResponseRedirect ( reverse ( 'project_version_list' , kwargs = { 'project_slug' : project_slug } ) )
project version delete html this marks a version as not built .