Quickfix for a boolean field

This commit is contained in:
Raphael Michel
2015-03-15 15:37:48 +01:00
parent 1154c54fd8
commit 4699c74810
2 changed files with 8 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ from django.forms.models import ModelFormMetaclass, BaseModelForm
from django import forms
from django.utils import six
from versions.models import Versionable
from django.utils.translation import ugettext_lazy as _
class VersionedBaseModelForm(BaseModelForm):
@@ -30,6 +31,10 @@ class SettingsForm(forms.Form):
"""
This form is meant to be used for modifying Event- or OrganizerSettings
"""
BOOL_CHOICES = (
('True', _('enabled')),
('False', _('disabled')),
)
def __init__(self, *args, **kwargs):
self.obj = kwargs.pop('obj')

View File

@@ -130,9 +130,10 @@ class PaymentSettings(EventPermissionRequiredMixin, TemplateView, SingleObjectMi
provider.form.fields = OrderedDict(
[
('payment_%s__enabled' % provider.identifier,
forms.BooleanField(
forms.ChoiceField(
label=_('Enable payment method'),
required=False
required=False,
choices=SettingsForm.BOOL_CHOICES,
)),
('payment_%s__fee_abs' % provider.identifier,
forms.DecimalField(