#NEWLINE# @ login_required ( ) #NEWLINE# def details( request , id ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# incident = Incident . objects . get ( id = id ) #NEWLINE# try : #NEWLINE# #INDENT# service_silenced = ServiceSilenced . objects . get ( service = incident . service_key ) . silenced #NEWLINE# #UNINDENT# except ServiceSilenced . DoesNotExist : #NEWLINE# #INDENT# service_silenced = False #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# is_obj = IncidentSilenced . objects . get ( incident = incident ) #NEWLINE# incident_silenced = str ( ( is_obj . silenced_until - timezone . now ( ) ) ) . split ( '.' ) [ 0 ] #NEWLINE# #UNINDENT# except IncidentSilenced . DoesNotExist : #NEWLINE# #INDENT# incident_silenced = False #NEWLINE# #UNINDENT# users = User . objects . all ( ) #NEWLINE# history = EventLog . objects . filter ( incident_key = incident ) . order_by ( '-occurred_at' ) #NEWLINE# return TemplateResponse ( users , 'incidents/details.html' , { #NEWLINE# #INDENT# 'item' : incident , #NEWLINE# 'users' : users , #NEWLINE# 'url' : request . get_full_path ( ) , #NEWLINE# 'history_list' : history , #NEWLINE# 'service_silenced' : service_silenced , #NEWLINE# 'incident_silenced' : incident_silenced , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# except Service . DoesNotExist : #NEWLINE# #INDENT# raise Http404