fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor fix
[wolnelektury.git]
/
src
/
funding
/
widgets.py
diff --git
a/src/funding/widgets.py
b/src/funding/widgets.py
index
8dc9742
..
e73a9ed
100644
(file)
--- a/
src/funding/widgets.py
+++ b/
src/funding/widgets.py
@@
-1,20
+1,20
@@
-# -*- coding: utf-8 -*-
-# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Wolne Lektury. 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):
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
return "_%s_perk" % name
- def render(self, name, value, attrs=None):
+ def render(self, name, value, attrs=None
, renderer=None
):
try:
value = Decimal(value)
try:
value = Decimal(value)
- except:
+ except
DecimalException
:
pass
perks = list(self.form_instance.offer.get_perks())
perk_chosen = False
pass
perks = list(self.form_instance.offer.get_perks())
perk_chosen = False