From d833fef64d92047c910189e7aac2cced07b1d6ff Mon Sep 17 00:00:00 2001 From: william Date: Wed, 13 Nov 2024 17:51:03 +1100 Subject: [PATCH] Update base.py --- .../stateless/stacks/metadata-manager/app/models/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/workload/stateless/stacks/metadata-manager/app/models/base.py b/lib/workload/stateless/stacks/metadata-manager/app/models/base.py index 4a2b0895e..5e47881b7 100644 --- a/lib/workload/stateless/stacks/metadata-manager/app/models/base.py +++ b/lib/workload/stateless/stacks/metadata-manager/app/models/base.py @@ -106,7 +106,8 @@ def update_or_create_if_needed(self, search_key: dict, data: dict, user_id: str try: obj = self.get(**search_key) for key, value in data.items(): - if getattr(obj, key) != value: + # compare both value in str format to avoid any type mismatch + if str(getattr(obj, key)) != str(value): setattr(obj, key, value) is_updated = True except self.model.DoesNotExist: