@login_required
def project_version_detail(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)
 form = VersionForm((request.POST or None), instance=version)
 if ((request.method == 'POST') and form.is_valid()):
  version = form.save()
  if form.has_changed():
   if (('active' in form.changed_data) and (version.active is False)):
    log.info(('Removing files for version %s' % version.slug))
    broadcast(type='app', task=tasks.clear_artifacts, args=[version.pk])
    version.built = False
    version.save()
  url = reverse('project_version_list', args=[project.slug])
  return HttpResponseRedirect(url)
 return render_to_response('projects/project_version_detail.html', {'form': form, 'project': project, 'version': version}, context_instance=RequestContext(request))

@ login_required def project_version_detail ( 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 ) form = VersionForm ( ( request . POST or None ) , instance = version ) if ( ( request . method == 'POST' ) and form . is_valid ( ) ) : version = form . save ( ) if form . has_changed ( ) : if ( ( 'active' in form . changed_data ) and ( version . active is False ) ) : log . info ( ( 'Removing files for version %s' % version . slug ) ) broadcast ( type = 'app' , task = tasks . clear_artifacts , args = [ version . pk ] ) version . built = False version . save ( ) url = reverse ( 'project_version_list' , args = [ project . slug ] ) return HttpResponseRedirect ( url ) return render_to_response ( 'projects/project_version_detail.html' , { 'form' : form , 'project' : project , 'version' : version } , context_instance = RequestContext ( request ) )
project version detail page .