Skip to content

Commit

Permalink
Change hint message for field-choices-constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Dec 6, 2024
1 parent 8acb037 commit b671038
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/extra_checks/checks/model_field_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,6 @@ def apply(
check = f'models.Q({in_name}=[{", ".join([self._repr_choice(c) for c in field_choices])}])'
yield self.message(
"Field with choices must have companion CheckConstraint to enforce choices on database level.",
hint=f'Add to Meta.constraints: `models.CheckConstraint(name="%(app_label)s_%(class)s_{field.name}_valid", check={check})`',
hint=f'Add to Meta.constraints: `models.CheckConstraint(name="%(app_label)s_%(class)s_{field.name}_valid", condition={check})`',
obj=field,
)

0 comments on commit b671038

Please sign in to comment.