@handle_response_format
@treeio_login_required
def set_delete(request, set_id, response_format='html'):
 changeset = get_object_or_404(ChangeSet, pk=set_id)
 if ((not request.user.profile.has_permission(changeset.object, mode='w')) and (not request.user.profile.is_admin('treeio.changes'))):
  return user_denied(request, "You don't have access to this Change Set.", response_format=response_format)
 if request.POST:
  if ('delete' in request.POST):
   if ('trash' in request.POST):
    changeset.trash = True
    changeset.save()
   else:
    changeset.delete()
   return HttpResponseRedirect(reverse('changes_index'))
  elif ('cancel' in request.POST):
   return HttpResponseRedirect(reverse('changes_set_view', args=[changeset.id]))
 context = _get_default_context(request)
 context.update({'changeset': changeset})
 return render_to_response('changes/set_delete', context, context_instance=RequestContext(request), response_format=response_format)

@ handle_response_format @ treeio_login_required def set_delete ( request , set_id , response_format = 'html' ) : changeset = get_object_or_404 ( ChangeSet , pk = set_id ) if ( ( not request . user . profile . has_permission ( changeset . object , mode = 'w' ) ) and ( not request . user . profile . is_admin ( 'treeio.changes' ) ) ) : return user_denied ( request , "You don't have access to this Change Set." , response_format = response_format ) if request . POST : if ( 'delete' in request . POST ) : if ( 'trash' in request . POST ) : changeset . trash = True changeset . save ( ) else : changeset . delete ( ) return HttpResponseRedirect ( reverse ( 'changes_index' ) ) elif ( 'cancel' in request . POST ) : return HttpResponseRedirect ( reverse ( 'changes_set_view' , args = [ changeset . id ] ) ) context = _get_default_context ( request ) context . update ( { 'changeset' : changeset } ) return render_to_response ( 'changes/set_delete' , context , context_instance = RequestContext ( request ) , response_format = response_format )
changeset delete .