Browse Source

Fixtures are now updateable.

Ralfp 12 years ago
parent
commit
f105ca0f66

+ 1 - 1
misago/acl/fixtures.py

@@ -2,7 +2,7 @@ from misago.acl.models import Role
 from misago.utils import ugettext_lazy as _
 from misago.utils import ugettext_lazy as _
 from misago.utils import get_msgid
 from misago.utils import get_msgid
 
 
-def load_fixture():
+def load_fixtures():
     role_admin = Role(
     role_admin = Role(
                       name=_("Administrator").message,
                       name=_("Administrator").message,
                       token='admin'
                       token='admin'

+ 1 - 1
misago/banning/fixtures.py

@@ -1,4 +1,4 @@
 from misago.monitor.fixtures import load_monitor_fixture
 from misago.monitor.fixtures import load_monitor_fixture
 
 
-def load_fixture():
+def load_fixtures():
     load_monitor_fixture({'bans_version': 0})
     load_monitor_fixture({'bans_version': 0})

+ 1 - 1
misago/forums/fixtures.py

@@ -6,5 +6,5 @@ monitor_fixtures = {
                   }
                   }
 
 
 
 
-def load_fixture():
+def load_fixtures():
     load_monitor_fixture(monitor_fixtures)
     load_monitor_fixture(monitor_fixtures)

+ 14 - 3
misago/security/fixtures.py

@@ -1,4 +1,4 @@
-from misago.settings.fixtures import load_settings_fixture
+from misago.settings.fixtures import load_settings_fixture, update_settings_fixture
 from misago.utils import ugettext_lazy as _
 from misago.utils import ugettext_lazy as _
 from misago.utils import get_msgid
 from misago.utils import get_msgid
 
 
@@ -16,6 +16,7 @@ settings_fixtures = (
                 'separator':    _("Spambots Registrations"),
                 'separator':    _("Spambots Registrations"),
                 'name':         _("CAPTCHA type"),
                 'name':         _("CAPTCHA type"),
                 'description':  _('CAPTCHA stands for "Completely Automated Public Turing test to tell Computers and Humans Apart". Its type of test developed on purpose of blocking automatic registrations.'),
                 'description':  _('CAPTCHA stands for "Completely Automated Public Turing test to tell Computers and Humans Apart". Its type of test developed on purpose of blocking automatic registrations.'),
+                'position':     0,
             }),
             }),
             ('recaptcha_public', {
             ('recaptcha_public', {
                 'type':         "string",
                 'type':         "string",
@@ -23,12 +24,14 @@ settings_fixtures = (
                 'separator':    _("reCaptcha"),
                 'separator':    _("reCaptcha"),
                 'name':         _("Public Key"),
                 'name':         _("Public Key"),
                 'description':  _("Enter public API key that you have received from reCaptcha."),
                 'description':  _("Enter public API key that you have received from reCaptcha."),
+                'position':     1,
             }),
             }),
             ('recaptcha_private', {
             ('recaptcha_private', {
                 'type':         "string",
                 'type':         "string",
                 'input':        "text",
                 'input':        "text",
                 'name':         _("Private Key"),
                 'name':         _("Private Key"),
                 'description':  _("Enter private API key that you have received from reCaptcha."),
                 'description':  _("Enter private API key that you have received from reCaptcha."),
+                'position':     2,
             }),
             }),
             ('qa_test', {
             ('qa_test', {
                 'type':         "string",
                 'type':         "string",
@@ -36,22 +39,30 @@ settings_fixtures = (
                 'separator':    _("Question and Answer Test"),
                 'separator':    _("Question and Answer Test"),
                 'name':         _("Question"),
                 'name':         _("Question"),
                 'description':  _("Question visible to your users."),
                 'description':  _("Question visible to your users."),
+                'position':     3,
             }),
             }),
             ('qa_test_help', {
             ('qa_test_help', {
                 'type':         "string",
                 'type':         "string",
                 'input':        "text",
                 'input':        "text",
                 'name':         _("Help Message"),
                 'name':         _("Help Message"),
                 'description':  _("Optional help message displayed on form."),
                 'description':  _("Optional help message displayed on form."),
+                'position':     4,
             }),
             }),
             ('qa_test_answers', {
             ('qa_test_answers', {
                 'type':         "string",
                 'type':         "string",
                 'input':        "textarea",
                 'input':        "textarea",
                 'name':         _("Answers"),
                 'name':         _("Answers"),
                 'description':  _("Enter allowed answers to this question, each in new line. Test is case-insensitive."),
                 'description':  _("Enter allowed answers to this question, each in new line. Test is case-insensitive."),
+                'position':     5,
             }),
             }),
         ),
         ),
     }),
     }),
 )
 )
 
 
-def load_fixture():
-    load_settings_fixture(settings_fixtures)
+
+def load_fixtures():
+    load_settings_fixture(settings_fixtures)
+
+
+def update_fixtures():
+    update_settings_fixture(settings_fixtures)

+ 74 - 8
misago/settings/fixtures.py

@@ -18,12 +18,14 @@ settings_fixture = (
                 'input':        "text",
                 'input':        "text",
                 'separator':    _("Board Name"),
                 'separator':    _("Board Name"),
                 'name':         _("Board Name"),
                 'name':         _("Board Name"),
+                'position':     0,
             }),
             }),
             ('board_header', {
             ('board_header', {
                 'type':         "string",
                 'type':         "string",
                 'input':        "text",
                 'input':        "text",
                 'name':         _("Board Header"),
                 'name':         _("Board Header"),
                 'description':  _("Some themes allow you to define text in board header. Leave empty to use Board Name instead."),
                 'description':  _("Some themes allow you to define text in board header. Leave empty to use Board Name instead."),
+                'position':     1,
             }),
             }),
             ('board_header_postscript', {
             ('board_header_postscript', {
                 'value':        "Work in progress ",
                 'value':        "Work in progress ",
@@ -31,6 +33,7 @@ settings_fixture = (
                 'input':        "text",
                 'input':        "text",
                 'name':         _("Board Header Postscript"),
                 'name':         _("Board Header Postscript"),
                 'description':  _("Additional text displayed in some themes board header after board name."),
                 'description':  _("Additional text displayed in some themes board header after board name."),
+                'position':     2,
             }),
             }),
             ('board_index_title', {
             ('board_index_title', {
                 'type':         "string",
                 'type':         "string",
@@ -38,12 +41,14 @@ settings_fixture = (
                 'separator':    _("Board Index"),
                 'separator':    _("Board Index"),
                 'name':         _("Board Index Title"),
                 'name':         _("Board Index Title"),
                 'description':  _("If you want to, you can replace page title content on Board Index with custom one."),
                 'description':  _("If you want to, you can replace page title content on Board Index with custom one."),
+                'position':     3,
             }),
             }),
             ('board_index_meta', {
             ('board_index_meta', {
                 'type':         "string",
                 'type':         "string",
                 'input':        "text",
                 'input':        "text",
                 'name':         _("Board Index Meta-Description"),
                 'name':         _("Board Index Meta-Description"),
                 'description':  _("Meta-Description used to describe your board's index page."),
                 'description':  _("Meta-Description used to describe your board's index page."),
+                'position':     4,
             }),
             }),
             ('board_credits', {
             ('board_credits', {
                 'type':         "string",
                 'type':         "string",
@@ -51,6 +56,7 @@ settings_fixture = (
                 'separator':    _("Board Footer"),
                 'separator':    _("Board Footer"),
                 'name':         _("Custom Credit"),
                 'name':         _("Custom Credit"),
                 'description':  _("Custom Credit to display in board footer above software and theme copyright information. You can use HTML."),
                 'description':  _("Custom Credit to display in board footer above software and theme copyright information. You can use HTML."),
+                'position':     5,
             }),
             }),
             ('email_footnote', {
             ('email_footnote', {
                 'type':         "string",
                 'type':         "string",
@@ -58,6 +64,7 @@ settings_fixture = (
                 'separator':    _("Board E-Mails"),
                 'separator':    _("Board E-Mails"),
                 'name':         _("Custom Footnote"),
                 'name':         _("Custom Footnote"),
                 'description':  _("Custom Footnote to display in e-mail messages sent by board."),
                 'description':  _("Custom Footnote to display in e-mail messages sent by board."),
+                'position':     6,
             }),
             }),
         ),
         ),
    }),
    }),
@@ -66,13 +73,13 @@ settings_fixture = (
 
 
 def load_settings_group_fixture(group, fixture):
 def load_settings_group_fixture(group, fixture):
     model_group = Group(
     model_group = Group(
-                  key=group,
-                  name=get_msgid(fixture['name']),
-                  description=get_msgid(fixture.get('description'))
-                  )
+                        key=group,
+                        name=get_msgid(fixture['name']),
+                        description=get_msgid(fixture.get('description'))
+                        )
     model_group.save(force_insert=True)
     model_group.save(force_insert=True)
-    position = 0
     fixture = fixture.get('settings', ())
     fixture = fixture.get('settings', ())
+    
     for setting in fixture:
     for setting in fixture:
         value = setting[1].get('value')
         value = setting[1].get('value')
         value_default = setting[1].get('default')
         value_default = setting[1].get('default')
@@ -93,18 +100,77 @@ def load_settings_group_fixture(group, fixture):
                                 type=setting[1].get('type'),
                                 type=setting[1].get('type'),
                                 input=setting[1].get('input'),
                                 input=setting[1].get('input'),
                                 extra=base64.encodestring(pickle.dumps(setting[1].get('extra', {}), pickle.HIGHEST_PROTOCOL)),
                                 extra=base64.encodestring(pickle.dumps(setting[1].get('extra', {}), pickle.HIGHEST_PROTOCOL)),
-                                position=position,
+                                position=setting[1].get('position'),
                                 separator=get_msgid(setting[1].get('separator')),
                                 separator=get_msgid(setting[1].get('separator')),
                                 name=get_msgid(setting[1].get('name')),
                                 name=get_msgid(setting[1].get('name')),
                                 description=get_msgid(setting[1].get('description')),
                                 description=get_msgid(setting[1].get('description')),
                             )
                             )
         model_setting.save(force_insert=True)
         model_setting.save(force_insert=True)
-        position += 1
 
 
 
 
+def update_settings_group_fixture(group, fixture):
+    try:
+        # Get and update group entry
+        model_group = Group.objects.get(key=group)
+        model_group.name = get_msgid(fixture['name'])
+        model_group.description = get_msgid(fixture.get('description'))
+        model_group.save(force_update=True)
+        
+        # Update group settings
+        fixture = fixture.get('settings', ())
+        for setting in fixture:
+            try:
+                # Update setting entry
+                model_setting = Setting.objects.get(setting=setting[0])
+                model_setting.value_default = value_default
+                model_setting.type = setting[1].get('type')
+                model_setting.input = setting[1].get('input')
+                model_setting.extra = base64.encodestring(pickle.dumps(setting[1].get('extra', {}), pickle.HIGHEST_PROTOCOL))
+                model_setting.position = setting[1].get('position')
+                model_setting.separator = get_msgid(setting[1].get('separator'))
+                model_setting.name = get_msgid(setting[1].get('name'))
+                model_setting.description = get_msgid(setting[1].get('description'))
+                model_setting.save(force_update=True)
+            except Setting.DoesNotExist:
+                # Create new setting entry
+                value = setting[1].get('value')
+                value_default = setting[1].get('default')
+                # Convert boolean True and False to 1 and 0, otherwhise it wont work
+                if setting[1].get('type') == 'boolean':
+                    value = 1 if value else 0
+                    value_default = 1 if value_default else 0
+                # Convert array value to string
+                if setting[1].get('type') == 'array':
+                    value = ','.join(value) if value else ''
+                    value_default = ','.join(value_default) if value_default else ''
+                # Store setting in database
+                model_setting = Setting(
+                                        setting=setting[0],
+                                        group=model_group,
+                                        value=value,
+                                        value_default=value_default,
+                                        type=setting[1].get('type'),
+                                        input=setting[1].get('input'),
+                                        extra=base64.encodestring(pickle.dumps(setting[1].get('extra', {}), pickle.HIGHEST_PROTOCOL)),
+                                        position=setting[1].get('position'),
+                                        separator=get_msgid(setting[1].get('separator')),
+                                        name=get_msgid(setting[1].get('name')),
+                                        description=get_msgid(setting[1].get('description')),
+                                    )
+                model_setting.save(force_insert=True)
+    except Group.DoesNotExist:
+        load_settings_group_fixture(group, fixture)
+    
+
 def load_settings_fixture(fixture):
 def load_settings_fixture(fixture):
     for group in fixture:
     for group in fixture:
         load_settings_group_fixture(group[0], group[1])
         load_settings_group_fixture(group[0], group[1])
     
     
-def load_fixture():
+    
+def update_settings_fixture(fixture):
+    for group in fixture:
+        update_settings_group_fixture(group[0], group[1])
+    
+    
+def load_fixtures():
     load_settings_fixture(settings_fixture)
     load_settings_fixture(settings_fixture)

+ 15 - 1
misago/setup/fixtures.py

@@ -8,7 +8,21 @@ def load_app_fixtures(app):
     app += '.fixtures'
     app += '.fixtures'
     try:
     try:
         fixture = import_module(app)
         fixture = import_module(app)
-        fixture.load_fixture()
+        fixture.load_fixtures()
+        return True
+    except (ImportError, AttributeError):
+        return False
+
+    
+def update_app_fixtures(app):
+    """
+    See if application has fixtures module defining update_fixtures function
+    If it does, execute that function
+    """
+    app += '.fixtures'
+    try:
+        fixture = import_module(app)
+        fixture.update_fixtures()
         return True
         return True
     except (ImportError, AttributeError):
     except (ImportError, AttributeError):
         return False
         return False

+ 1 - 1
misago/setup/management/commands/loadfixtures.py

@@ -6,7 +6,7 @@ from optparse import make_option
 
 
 class Command(BaseCommand):
 class Command(BaseCommand):
     """
     """
-    Loads misago fixtures
+    Loads Misago fixtures
     """
     """
     help = 'Load Misago fixtures'
     help = 'Load Misago fixtures'
     def handle(self, *args, **options):
     def handle(self, *args, **options):

+ 18 - 0
misago/setup/management/commands/updatefixtures.py

@@ -0,0 +1,18 @@
+from django.conf import settings
+from django.core.management.base import BaseCommand, CommandError
+from django.utils import timezone
+from misago.setup.fixtures import update_app_fixtures
+from optparse import make_option
+
+class Command(BaseCommand):
+    """
+    Updates Misago fixtures
+    """
+    help = 'Update Misago fixtures'
+    def handle(self, *args, **options):
+        fixtures = 0
+        for app in settings.INSTALLED_APPS:
+            if update_app_fixtures(app):
+                fixtures += 1
+                print 'Updating fixtures from %s' % app
+        self.stdout.write('\nUpdated fixtures from %s applications.\n' % fixtures)

+ 23 - 3
misago/users/fixtures.py

@@ -1,5 +1,5 @@
 from misago.monitor.fixtures import load_monitor_fixture
 from misago.monitor.fixtures import load_monitor_fixture
-from misago.settings.fixtures import load_settings_fixture
+from misago.settings.fixtures import load_settings_fixture, update_settings_fixture
 from misago.users.models import Rank
 from misago.users.models import Rank
 from misago.utils import ugettext_lazy as _
 from misago.utils import ugettext_lazy as _
 from misago.utils import get_msgid
 from misago.utils import get_msgid
@@ -27,6 +27,7 @@ settings_fixtures = (
                 'separator':    _("General Settings"),
                 'separator':    _("General Settings"),
                 'name':         _("Allowed Avatars"),
                 'name':         _("Allowed Avatars"),
                 'description':  _("Select Avatar types allowed on your forum."),
                 'description':  _("Select Avatar types allowed on your forum."),
+                'position':     0,
             }),
             }),
             ('default_avatar', {
             ('default_avatar', {
                 'value':        "gravatar",
                 'value':        "gravatar",
@@ -35,6 +36,7 @@ settings_fixtures = (
                 'extra':        {'choices': [('gravatar', _("Gravatar")), ('gallery', _("Random Avatar from Gallery"))]},
                 'extra':        {'choices': [('gravatar', _("Gravatar")), ('gallery', _("Random Avatar from Gallery"))]},
                 'name':         _("Default Avatar"),
                 '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."),
                 '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."),
+                'position':     1,
             }),
             }),
             ('upload_limit', {
             ('upload_limit', {
                 'value':        128,
                 'value':        128,
@@ -44,6 +46,7 @@ settings_fixtures = (
                 'separator':    _("Avatar Upload Settings"),
                 'separator':    _("Avatar Upload Settings"),
                 'name':         _("Maxmimum size of uploaded file"),
                 'name':         _("Maxmimum size of uploaded file"),
                 'description':  _("Select maximum allowed file size (in KB) for Avatar uploads."),
                 'description':  _("Select maximum allowed file size (in KB) for Avatar uploads."),
+                'position':     2,
             }),
             }),
        ),
        ),
     }),
     }),
@@ -58,6 +61,7 @@ settings_fixtures = (
                 'extra':        {'choices': [('', _("No validation required")), ('user', _("Activation Token sent to User")), ('admin', _("Activation by Administrator")), ('block', _("Dont allow new registrations"))]},
                 'extra':        {'choices': [('', _("No validation required")), ('user', _("Activation Token sent to User")), ('admin', _("Activation by Administrator")), ('block', _("Dont allow new registrations"))]},
                 'separator':    _("Users Registrations"),
                 'separator':    _("Users Registrations"),
                 'name':         _("New accounts validation"),
                 'name':         _("New accounts validation"),
+                'position':     0,
             }),
             }),
             ('default_timezone', {
             ('default_timezone', {
                 'value':        "utc",
                 'value':        "utc",
@@ -66,6 +70,7 @@ settings_fixtures = (
                 'extra':        {'choices': '#TZ#'},
                 'extra':        {'choices': '#TZ#'},
                 'name':         _("Default Timezone"),
                 'name':         _("Default Timezone"),
                 'description':  _("Used by guests, crawlers and newly registered users."),
                 'description':  _("Used by guests, crawlers and newly registered users."),
+                'position':     1,
             }),
             }),
             ('password_length', {
             ('password_length', {
                 'value':        4,
                 'value':        4,
@@ -74,6 +79,7 @@ settings_fixtures = (
                 'extra':        {'min': 1},
                 'extra':        {'min': 1},
                 'separator':    _("Users Passwords"),
                 'separator':    _("Users Passwords"),
                 'name':         _("Minimum user password length"),
                 'name':         _("Minimum user password length"),
+                'position':     2,
             }),
             }),
             ('password_complexity', {
             ('password_complexity', {
                 'value':        [],
                 'value':        [],
@@ -81,6 +87,7 @@ settings_fixtures = (
                 'input':        "mlist",
                 'input':        "mlist",
                 'extra':        {'choices': [('case', _("Require mixed Case")), ('digits', _("Require digits")), ('special', _("Require special characters"))]},
                 'extra':        {'choices': [('case', _("Require mixed Case")), ('digits', _("Require digits")), ('special', _("Require special characters"))]},
                 'name':         _("Password Complexity"),
                 'name':         _("Password Complexity"),
+                'position':     3,
             }),
             }),
             ('password_lifetime', {
             ('password_lifetime', {
                 'value':        0,
                 'value':        0,
@@ -89,6 +96,7 @@ settings_fixtures = (
                 'extra':        {'min': 0},
                 'extra':        {'min': 0},
                 'name':         _("Password Lifetime"),
                 'name':         _("Password Lifetime"),
                 'description':  _("Enter number of days since password was set to force member to change it with new one, or 0 to dont force your members to change their passwords."),
                 'description':  _("Enter number of days since password was set to force member to change it with new one, or 0 to dont force your members to change their passwords."),
+                'position':     4,
             }),
             }),
             ('sessions_hidden', {
             ('sessions_hidden', {
                 'value':        True,
                 'value':        True,
@@ -97,6 +105,7 @@ settings_fixtures = (
                 'separator':    _("Sessions Settings"),
                 'separator':    _("Sessions Settings"),
                 'name':         _("Allow hidden sessions"),
                 'name':         _("Allow hidden sessions"),
                 'description':  _("Enabling this option will allow users to hide their presence on forums from other members."),
                 'description':  _("Enabling this option will allow users to hide their presence on forums from other members."),
+                'position':     5,
             }),
             }),
             ('sessions_validate_ip', {
             ('sessions_validate_ip', {
                 'value':        True,
                 'value':        True,
@@ -104,6 +113,7 @@ settings_fixtures = (
                 'input':        "yesno",
                 'input':        "yesno",
                 'name':         _("Check IP on session authorization"),
                 'name':         _("Check IP on session authorization"),
                 'description':  _("Makes sessions more secure, but can cause problems with proxies and VPN's."),
                 'description':  _("Makes sessions more secure, but can cause problems with proxies and VPN's."),
+                'position':     6,
             }),
             }),
             ('remember_me_allow', {
             ('remember_me_allow', {
                 'value':        True,
                 'value':        True,
@@ -112,6 +122,7 @@ settings_fixtures = (
                 'separator':    _("Sign-In Settings"),
                 'separator':    _("Sign-In Settings"),
                 'name':         _('Enable "Remember Me" functionality'),
                 'name':         _('Enable "Remember Me" functionality'),
                 'description':  _("Turning this option on allows users to sign in on to your board using cookie-based tokens. This may result in account compromisation when user fails to sign out on shared computer."),
                 'description':  _("Turning this option on allows users to sign in on to your board using cookie-based tokens. This may result in account compromisation when user fails to sign out on shared computer."),
+                'position':     7,
             }),
             }),
             ('remember_me_lifetime', {
             ('remember_me_lifetime', {
                 'value':        90,
                 'value':        90,
@@ -126,6 +137,7 @@ settings_fixtures = (
                 'input':        "yesno",
                 'input':        "yesno",
                 'name':         _('Allow "Remember Me" tokens refreshing'),
                 'name':         _('Allow "Remember Me" tokens refreshing'),
                 'description':  _('Set this setting to off if you want to force your users to periodically update their "Remember Me" tokens by signing in. If this option is on, Tokens are updated when they are used to open new session.'),
                 'description':  _('Set this setting to off if you want to force your users to periodically update their "Remember Me" tokens by signing in. If this option is on, Tokens are updated when they are used to open new session.'),
+                'position':     8,
             }),
             }),
             ('login_attempts_limit', {
             ('login_attempts_limit', {
                 'value':        3,
                 'value':        3,
@@ -135,6 +147,7 @@ settings_fixtures = (
                 'separator':    _("Brute-Force Countermeasures"),
                 'separator':    _("Brute-Force Countermeasures"),
                 'name':         _("Limit Sign In attempts"),
                 'name':         _("Limit Sign In attempts"),
                 'description':  _('Enter maximal number of allowed Sign In attempts before IP address "jams".'),
                 'description':  _('Enter maximal number of allowed Sign In attempts before IP address "jams".'),
+                'position':     9,
             }),
             }),
             ('registrations_jams', {
             ('registrations_jams', {
                 'value':        1,
                 'value':        1,
@@ -143,6 +156,7 @@ settings_fixtures = (
                 'input':        "yesno",
                 'input':        "yesno",
                 'name':         _("Count failed register attempts too"),
                 'name':         _("Count failed register attempts too"),
                 'description':  _("Set this setting to yes if you want failed register attempts to count into limit."),
                 'description':  _("Set this setting to yes if you want failed register attempts to count into limit."),
+                'position':     10,
             }),
             }),
             ('jams_lifetime', {
             ('jams_lifetime', {
                 'value':        15,
                 'value':        15,
@@ -151,12 +165,14 @@ settings_fixtures = (
                 'input':        "text",
                 'input':        "text",
                 'name':         _("Automaticaly unlock jammed IPs"),
                 'name':         _("Automaticaly unlock jammed IPs"),
                 'description':  _('Enter number of minutes since IP address "jams" to automatically unlock it, or 0 to never unlock jammed IP adresses. Jams dont count as bans.'),
                 'description':  _('Enter number of minutes since IP address "jams" to automatically unlock it, or 0 to never unlock jammed IP adresses. Jams dont count as bans.'),
+                'position':     11,
             }),
             }),
         ),
         ),
     }),
     }),
 )
 )
 
 
-def load_fixture():
+
+def load_fixtures():
     load_monitor_fixture(monitor_fixtures)
     load_monitor_fixture(monitor_fixtures)
     load_settings_fixture(settings_fixtures)
     load_settings_fixture(settings_fixtures)
     
     
@@ -191,4 +207,8 @@ def load_fixture():
     rank_staff.save(force_insert=True)
     rank_staff.save(force_insert=True)
     rank_lurker.save(force_insert=True)
     rank_lurker.save(force_insert=True)
     rank_member.save(force_insert=True)
     rank_member.save(force_insert=True)
-    rank_active.save(force_insert=True)
+    rank_active.save(force_insert=True)
+    
+    
+def update_fixtures():
+    update_settings_fixture(settings_fixtures)