Skip to content

Commit

Permalink
fix validate_action method
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranshu1902 committed Mar 5, 2024
1 parent 4fa4c39 commit e47ae9e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion care/utils/assetintegration/onvif.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ def validate_action(self, action):
action_data = action.get("data", {})
asset_bed_id = action_data.get("id", None)

# if action is not relative_move or asset_id not provided then skip boundary checks
if not asset_bed_id or action_type != self.OnvifActions.RELATIVE_MOVE.value:
raise ValidationError({"asset": "Asset id not providede"})
return

boundary_preset = AssetBed.objects.get(external_id=asset_bed_id)

Expand Down

0 comments on commit e47ae9e

Please sign in to comment.