add & fix - transaction dashboard / edit distribution with stat validation bug
This commit is contained in:
@@ -50,14 +50,14 @@ class QuotaStatsValidator:
|
||||
if amount < 0:
|
||||
raise DistributionException("مقدار وزن نباید منفی باشد", status.HTTP_403_FORBIDDEN) # noqa
|
||||
|
||||
if remaining < amount and not allow_zero:
|
||||
if remaining + amount < amount and not allow_zero:
|
||||
if update_operation:
|
||||
raise DistributionException(
|
||||
"مقدار وزن ویرایش شده از وزن باقیمانده بیشتر است", # noqa
|
||||
status.HTTP_403_FORBIDDEN
|
||||
)
|
||||
raise DistributionException(
|
||||
f"تخصیص مقدار {amount} بیشتر از مقدار باقیمانده {remaining} برای سازمان {assigner_org.name} میباشد.",
|
||||
f"تخصیص مقدار {amount} بیشتر از مقدار باقیمانده {remaining + amount} برای سازمان {assigner_org.name} میباشد.",
|
||||
# noqa
|
||||
status.HTTP_403_FORBIDDEN
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user