@handle_response_format
@treeio_login_required
def status_delete(request, status_id, response_format='html'):
 status = get_object_or_404(TicketStatus, pk=status_id)
 if (not request.user.profile.has_permission(status, mode='w')):
  return user_denied(request, "You don't have access to this Ticket Status", response_format)
 if request.POST:
  if ('delete' in request.POST):
   if ('trash' in request.POST):
    status.trash = True
    status.save()
   else:
    status.delete()
   return HttpResponseRedirect(reverse('services_settings_view'))
  elif ('cancel' in request.POST):
   return HttpResponseRedirect(reverse('services_status_view', args=[status.id]))
 context = _get_default_context(request)
 context.update({'status': status})
 return render_to_response('services/status_delete', context, context_instance=RequestContext(request), response_format=response_format)

@ handle_response_format @ treeio_login_required def status_delete ( request , status_id , response_format = 'html' ) : status = get_object_or_404 ( TicketStatus , pk = status_id ) if ( not request . user . profile . has_permission ( status , mode = 'w' ) ) : return user_denied ( request , "You don't have access to this Ticket Status" , response_format ) if request . POST : if ( 'delete' in request . POST ) : if ( 'trash' in request . POST ) : status . trash = True status . save ( ) else : status . delete ( ) return HttpResponseRedirect ( reverse ( 'services_settings_view' ) ) elif ( 'cancel' in request . POST ) : return HttpResponseRedirect ( reverse ( 'services_status_view' , args = [ status . id ] ) ) context = _get_default_context ( request ) context . update ( { 'status' : status } ) return render_to_response ( 'services/status_delete' , context , context_instance = RequestContext ( request ) , response_format = response_format )
status delete .