fix: some fixes

This commit is contained in:
ITQ
2025-02-22 07:10:40 +03:00
parent 813ab0a459
commit ec47e7754e
3 changed files with 14 additions and 14 deletions
@@ -11,18 +11,16 @@ if TYPE_CHECKING:
class CampaignTargetingLocationValidator:
def __call__(self, instance: "Campaign") -> None:
if instance.location == "":
err = {
"targeting": {
type(
instance
).location.field.name: Field.default_error_messages[
"blank"
]
}
}
err = "targeting.location can't be blank."
raise ValidationError(err)
class CampaignTargetingGenderValidator:
def __call__(self, instance: "Campaign") -> None:
if instance.gender == "":
err = "gender can't be blank."
raise ValidationError(err)
class CampaignAgeValidator:
def __call__(self, instance: "Campaign") -> None:
if (
@@ -75,9 +73,5 @@ class CampaignStartDateValidator:
class CampaignReportMessageValidator:
def __call__(self, instance: "CampaignReport") -> None:
if instance.message == "":
err = {
instance.message.field.name: Field.default_error_messages[
"blank"
]
}
err = "message can't be blank."
raise ValidationError(err)