@check_event_permissions
def cancel_occurrence(request, event_id, template_name='schedule/cancel_occurrence.html', *args, **kwargs):
 (event, occurrence) = get_occurrence(event_id, *args, **kwargs)
 next = (kwargs.get('next', None) or get_next_url(request, event.get_absolute_url()))
 if (request.method != 'POST'):
  return render_to_response(template_name, {'occurrence': occurrence, 'next': next}, context_instance=RequestContext(request))
 occurrence.cancel()
 return HttpResponseRedirect(next)

@ check_event_permissions def cancel_occurrence ( request , event_id , template_name = 'schedule/cancel_occurrence.html' , * args , ** kwargs ) : ( event , occurrence ) = get_occurrence ( event_id , * args , ** kwargs ) next = ( kwargs . get ( 'next' , None ) or get_next_url ( request , event . get_absolute_url ( ) ) ) if ( request . method != 'POST' ) : return render_to_response ( template_name , { 'occurrence' : occurrence , 'next' : next } , context_instance = RequestContext ( request ) ) occurrence . cancel ( ) return HttpResponseRedirect ( next )
this view is used to cancel an occurrence .