Skip to content

Commit

Permalink
minimal speed improvement by reordering checks (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
devkral authored Oct 6, 2024
1 parent 2838282 commit 9bcfca4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion edgy/core/db/models/metaclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def _set_related_field(
source: type["BaseModelType"],
replace_related_field: bool,
) -> None:
if related_name in target.meta.fields and not replace_related_field:
if not replace_related_field and related_name in target.meta.fields:
# is already correctly set, required for migrate of model_apps with registry set
related_field = target.meta.fields[related_name]
if (
Expand Down

0 comments on commit 9bcfca4

Please sign in to comment.