]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/settings/base.py
Fix problem with dummy actions. Also try coercion of settings to the same type as...
[osqa.git] / forum / settings / base.py
index 5bcf5fc51a6d929c6c82209c15ca2a3b1d22e9a9..db02b6c15ab0d17637e1b6779f0720e776b24733 100644 (file)
@@ -66,7 +66,10 @@ class BaseSetting(object):
         self.set_value(self.default)
 
     def _parse(self, value):
-        return value
+        try:
+            return self.base_type(value)
+        except:
+            return value
 
 
 class Setting(object):
@@ -80,6 +83,7 @@ class Setting(object):
             emul = Setting.emulators[deftype]
         else:
             emul = type(deftype.__name__ + cls.__name__, (BaseSetting,), {})
+            emul.base_type = deftype
             fns = [n for n, f in [(p, getattr(deftype, p)) for p in dir(deftype) if not p in dir(cls)] if callable(f)]
 
             for n in fns: