X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/2fea31c78fb2dbbbabda91c64aab0760adba517c..b2d342589a7889a3b096e7192453d53bd28eed7d:/src/funding/widgets.py?ds=inline diff --git a/src/funding/widgets.py b/src/funding/widgets.py index 8dc9742ce..f66cde341 100644 --- a/src/funding/widgets.py +++ b/src/funding/widgets.py @@ -2,19 +2,20 @@ # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # -from decimal import Decimal +from decimal import Decimal, DecimalException from django import forms from django.template.loader import render_to_string class PerksAmountWidget(forms.Textarea): - def perks_input_name(self, name): + @staticmethod + def perks_input_name(name): return "_%s_perk" % name def render(self, name, value, attrs=None): try: value = Decimal(value) - except: + except DecimalException: pass perks = list(self.form_instance.offer.get_perks()) perk_chosen = False