Commit ea948deb by Kálmán Viktor

dashboard: handle resultant state being None

parent 32edaf0d
...@@ -312,6 +312,7 @@ class VmDetailView(CheckedDetailView): ...@@ -312,6 +312,7 @@ class VmDetailView(CheckedDetailView):
context['show_show_all'] = show_show_all context['show_show_all'] = show_show_all
latest = instance.get_latest_activity_in_progress() latest = instance.get_latest_activity_in_progress()
context['is_new_state'] = (latest and context['is_new_state'] = (latest and
latest.resultant_state is not None and
instance.status != latest.resultant_state) instance.status != latest.resultant_state)
context['vlans'] = Vlan.get_objects_with_level( context['vlans'] = Vlan.get_objects_with_level(
...@@ -2460,8 +2461,8 @@ def vm_activity(request, pk): ...@@ -2460,8 +2461,8 @@ def vm_activity(request, pk):
response['status'] = instance.status response['status'] = instance.status
response['icon'] = instance.get_status_icon() response['icon'] = instance.get_status_icon()
latest = instance.get_latest_activity_in_progress() latest = instance.get_latest_activity_in_progress()
response['is_new_state'] = (latest and response['is_new_state'] = (latest and latest.resultant_state is not None
instance.status != latest.resultant_state) and instance.status != latest.resultant_state)
context = { context = {
'instance': instance, 'instance': instance,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment