Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(mm): Broken Comparison on Update #691

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down