From e47ae9ec159324fc7f2d3a4a391151e7b4e61aec Mon Sep 17 00:00:00 2001 From: Pranshu1902 Date: Wed, 6 Mar 2024 02:01:03 +0530 Subject: [PATCH] fix validate_action method --- care/utils/assetintegration/onvif.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/care/utils/assetintegration/onvif.py b/care/utils/assetintegration/onvif.py index 532dca47d4..5537b41071 100644 --- a/care/utils/assetintegration/onvif.py +++ b/care/utils/assetintegration/onvif.py @@ -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)