Skip to content

Commit

Permalink
Handle missing instance.resolved_middleware in asset_updates (#2084)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashesh3 authored Apr 15, 2024
1 parent 32a9b0b commit 830a82b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion care/facility/signals/asset_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ def save_asset_fields_before_update(
def update_asset_config_on_middleware(
sender, instance, created, raw, using, update_fields, **kwargs
):
if raw or (update_fields and "meta" not in update_fields):
if (
raw
or (update_fields and "meta" not in update_fields)
or (instance.resolved_middleware is None)
):
return

new_hostname = instance.resolved_middleware.get("hostname")
Expand Down

0 comments on commit 830a82b

Please sign in to comment.