#NEWLINE# @ login_required ( ) #NEWLINE# @ require_http_methods ( [ 'POST' ] ) #NEWLINE# def unsilence( request , service_id ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# service = Service . objects . get ( id = service_id ) #NEWLINE# url = request . POST . get ( 'url' ) #NEWLINE# try : #NEWLINE# #INDENT# ServiceSilenced . objects . filter ( service = service ) . delete ( ) #NEWLINE# event_log_message = ( '%s removed silence from service %s' % ( request . user . username , service . name ) ) #NEWLINE# event_log = EventLog ( ) #NEWLINE# event_log . action = 'unsilence_service' #NEWLINE# event_log . user = service_id . user #NEWLINE# event_log . incident_key = None #NEWLINE# event_log . service_key = service #NEWLINE# event_log . data = event_log_message #NEWLINE# event_log . occurred_at = timezone . now ( ) #NEWLINE# event_log . save ( ) #NEWLINE# #UNINDENT# except ServiceSilenced . DoesNotExist : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# return HttpResponseRedirect ( url ) #NEWLINE# #UNINDENT# except Service . DoesNotExist : #NEWLINE# #INDENT# raise Http404