Skip to content

Commit

Permalink
Fix condition text transaction/select_for_update
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMadBug committed Sep 14, 2023
1 parent ce159bd commit 04393ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classification/models/condition_text_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ def sync_condition_text_classification(cm: ClassificationModification, update_co
ct: ConditionText
ct, ct_is_new = ConditionText.objects.get_or_create(normalized_text=normalized, lab=lab)

ct = ConditionText.objects.select_for_update().filter(pk=ct.pk).first()
with transaction.atomic():
ct = ConditionText.objects.select_for_update().filter(pk=ct.pk).first()

# ensure each step of the hierarchy is present
root, new_root = ConditionTextMatch.objects.get_or_create(
Expand Down

0 comments on commit 04393ef

Please sign in to comment.