fix: postchecks fix, added validation to target type

btw small refactoring
This commit is contained in:
ITQ
2025-01-29 19:22:02 +03:00
parent 9f3a08d39d
commit 2cb8f81cb1
3 changed files with 25 additions and 8 deletions
+1 -3
View File
@@ -12,9 +12,7 @@ def map_promocode_to_schema(promocode: Promocode) -> schemas.PromocodeViewOut:
target=schemas.PromocodeTargetViewOut(
age_from=promocode.target.age_from,
age_until=promocode.target.age_until,
country=promocode.target.country_raw
if promocode.target.country_raw
else None,
country=promocode.target.country_raw or None,
categories=promocode.target.categories,
),
max_count=promocode.max_count,