Browse Source

Remove erro de divisão por zero

pull/169/head 3.0.60
Sesóstris Vieira 1 year ago
parent
commit
f0d8ce9465
  1. 6
      sigi/apps/eventos/admin.py

6
sigi/apps/eventos/admin.py

@ -1053,7 +1053,11 @@ class EventoAdmin(CartExportReportMixin, admin.ModelAdmin):
custo_total=(F("equipe__qtde_diarias") * F("equipe__valor_diaria"))
+ F("equipe__total_passagens"),
custo_participante=Cast(
F("custo_total") / F("total_participantes"),
Case(
When(total_participantes__lte=0, then=None),
default=F("custo_total") / F("total_participantes"),
output_field=my_decimal_field,
),
output_field=my_decimal_field,
),
)

Loading…
Cancel
Save