Browse Source

Fixed fixture loader

Rafał Pitoń 12 years ago
parent
commit
efe94d69bf
2 changed files with 47 additions and 47 deletions
  1. 46 46
      misago/fixtures/avatarssettings.py
  2. 1 1
      misago/utils/fixtures.py

+ 46 - 46
misago/fixtures/avatarssettings.py

@@ -1,46 +1,46 @@
-from misago.utils.fixtures import load_settings_fixture, update_settings_fixture
-from misago.utils.translation import ugettext_lazy as _
-
-settings_fixture = (
-    # Avatars Settings
-    ('avatars', {
-         'name': _("Users Avatars Settings"),
-         'description': _("Those settings allow you to control your users avatars."),
-         'settings': (
-            ('avatars_types', {
-                'value':        ['gravatar', 'gallery'],
-                'type':         "array",
-                'input':        "mlist",
-                'extra':        {'choices': [('gravatar', _("Gravatar")), ('upload', _("Uploaded Avatar")), ('gallery', _("Avatars Gallery"))]},
-                'separator':    _("General Settings"),
-                'name':         _("Allowed Avatars"),
-                'description':  _("Select Avatar types allowed on your forum."),
-            }),
-            ('default_avatar', {
-                'value':        "gravatar",
-                'type':         "string",
-                'input':        "select",
-                'extra':        {'choices': [('gravatar', _("Gravatar")), ('gallery', _("Random Avatar from Gallery"))]},
-                'name':         _("Default Avatar"),
-                'description':  _("Default Avatar assigned to new members. If you creade directory and name it \"_default\", forum will select random avatar from that directory instead of regular gallery. If no avatar can be picked from gallery, Gravatar will be used."),
-            }),
-            ('upload_limit', {
-                'value':        128,
-                'type':         "integer",
-                'input':        "text",
-                'extra':        {'min': 0},
-                'separator':    _("Avatar Upload Settings"),
-                'name':         _("Maxmimum size of uploaded file"),
-                'description':  _("Select maximum allowed file size (in KB) for Avatar uploads."),
-            }),
-       ),
-    }),
-)
-
-
-def load():
-    load_settings_fixture(settings_fixture)
-
-
-def update():
-    update_settings_fixture(settings_fixture)
+from misago.utils.fixtures import load_settings_fixture, update_settings_fixture
+from misago.utils.translation import ugettext_lazy as _
+
+settings_fixture = (
+    # Avatars Settings
+    ('avatars', {
+         'name': _("Users Avatars Settings"),
+         'description': _("Those settings allow you to control your users avatars."),
+         'settings': (
+            ('avatars_types', {
+                'value':        ('gravatar', 'gallery'),
+                'type':         "array",
+                'input':        "mlist",
+                'extra':        {'choices': [('gravatar', _("Gravatar")), ('upload', _("Uploaded Avatar")), ('gallery', _("Avatars Gallery"))]},
+                'separator':    _("General Settings"),
+                'name':         _("Allowed Avatars"),
+                'description':  _("Select Avatar types allowed on your forum."),
+            }),
+            ('default_avatar', {
+                'value':        "gravatar",
+                'type':         "string",
+                'input':        "select",
+                'extra':        {'choices': [('gravatar', _("Gravatar")), ('gallery', _("Random Avatar from Gallery"))]},
+                'name':         _("Default Avatar"),
+                'description':  _("Default Avatar assigned to new members. If you creade directory and name it \"_default\", forum will select random avatar from that directory instead of regular gallery. If no avatar can be picked from gallery, Gravatar will be used."),
+            }),
+            ('upload_limit', {
+                'value':        128,
+                'type':         "integer",
+                'input':        "text",
+                'extra':        {'min': 0},
+                'separator':    _("Avatar Upload Settings"),
+                'name':         _("Maxmimum size of uploaded file"),
+                'description':  _("Select maximum allowed file size (in KB) for Avatar uploads."),
+            }),
+       ),
+    }),
+)
+
+
+def load():
+    load_settings_fixture(settings_fixture)
+
+
+def update():
+    update_settings_fixture(settings_fixture)

+ 1 - 1
misago/utils/fixtures.py

@@ -56,7 +56,7 @@ def load_settings_group_fixture(group, fixture):
         model_setting = Setting(
                                 setting=setting[0],
                                 group=model_group,
-                                value=value,
+                                _value=value,
                                 value_default=value_default,
                                 normalize_to=setting[1].get('type'),
                                 field=setting[1].get('input'),