add & fix - transaction dashboard / edit distribution with stat validation bug
This commit is contained in:
@@ -81,12 +81,14 @@ def get_rancher_statistic_by_herd(rancher: Rancher = None) -> typing.Any:
|
||||
def rancher_quota_weight(
|
||||
rancher: Rancher,
|
||||
inventory_entry: InventoryEntry = None,
|
||||
distribution: QuotaDistribution = None
|
||||
distribution: QuotaDistribution = None,
|
||||
quota: Quota = None
|
||||
):
|
||||
"""
|
||||
:param rancher: Rancher instance
|
||||
:param inventory_entry: InventoryEntry instance
|
||||
:param distribution: QuotaDistribution instance
|
||||
:param quota: Quota instance
|
||||
:return: dict {total, by_type}
|
||||
"""
|
||||
|
||||
@@ -103,7 +105,7 @@ def rancher_quota_weight(
|
||||
elif distribution:
|
||||
quota: Quota = distribution.quota
|
||||
else:
|
||||
quota: Quota = Quota()
|
||||
quota: Quota = quota
|
||||
|
||||
# list of quota live stock allocations
|
||||
allocations = list(quota.livestock_allocations.all().select_related('livestock_type'))
|
||||
|
||||
Reference in New Issue
Block a user