Browse Source

Fixed YesNoFields used to change settings

Rafał Pitoń 11 years ago
parent
commit
4856c11d9b
2 changed files with 1 additions and 6 deletions
  1. 1 1
      misago/conf/forms.py
  2. 0 5
      misago/core/forms.py

+ 1 - 1
misago/conf/forms.py

@@ -107,7 +107,7 @@ def create_textarea(setting, kwargs, extra):
 
 
 def create_yesno(setting, kwargs, extra):
-    return forms.YesNoSwitch()
+    return forms.YesNoSwitch(**kwargs)
 
 
 FIELD_STYPES = {

+ 0 - 5
misago/core/forms.py

@@ -19,11 +19,6 @@ class YesNoSwitchBase(TypedChoiceField):
 
 
 def YesNoSwitch(**kwargs):
-    if 'initial' not in kwargs:
-        kwargs['initial'] = 0
-
-    kwargs['initial'] = 1 if kwargs['initial'] else 0
-
     return YesNoSwitchBase(
         coerce=int,
         choices=((1, _("Yes")), (0, _("No"))),