mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
money template filter: coerce None to 0.00
This commit is contained in:
@@ -34,6 +34,8 @@ register = template.Library()
|
||||
def money_filter(value: Decimal, arg='', hide_currency=False):
|
||||
if isinstance(value, (float, int)):
|
||||
value = Decimal(value)
|
||||
if value is None:
|
||||
value = Decimal('0.00')
|
||||
if not isinstance(value, Decimal):
|
||||
if value == '':
|
||||
return value
|
||||
|
||||
Reference in New Issue
Block a user