lib/perus/server/views/index.erb in perus-0.1.28 vs lib/perus/server/views/index.erb in perus-0.1.29
- old
+ new
@@ -11,10 +11,14 @@
<% if alert.active_alerts.empty? %>
<p>All systems functioning normally</p>
<% else %>
<ul class="alerts">
<% alert.active_alerts.each do |active_alert| %>
- <li class="<%= alert.severity %>"><a href="<%= url_prefix %>systems/<%= active_alert.system.id %>"><%= active_alert.system.name %> (<%= active_alert.active_for %>)</a></li>
+ <% if alert.system %>
+ <li class="<%= alert.severity %>"><a href="<%= url_prefix %>systems/<%= active_alert.system.id %>"><%= active_alert.system.name %> (<%= active_alert.active_for %>)</a></li>
+ <% else %>
+ <li class="<%= alert.severity %>">Alert for deleted system: <%= active_alert.system_id %> (<%= active_alert.active_for %>)</li>
+ <% end %>
<% end %>
</ul>
<% end %>
<% end %>
</div>