Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Валидация цен #320

Open
andprov opened this issue May 28, 2024 · 0 comments
Open

Валидация цен #320

andprov opened this issue May 28, 2024 · 0 comments
Labels
invalid This doesn't seem right

Comments

@andprov
Copy link
Contributor

andprov commented May 28, 2024

Необходима корректировка Django модели с ценами.

Нет валидации цен. Можно легко вносить отрицательные значения.

class Price(models.Model):
    ...
    price_reg = models.DecimalField("Регистрация", max_digits=10, decimal_places=2)
    price_prolong = models.DecimalField("Продление", max_digits=10, decimal_places=2)
    price_change = models.DecimalField("Перенос", max_digits=10, decimal_places=2)
    ...

Хотя бы что то примитивное типо так:

validators=[MinValueValidator(Decimal('0.01'))]
@andprov andprov added the invalid This doesn't seem right label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant