Skip to content
Snippets Groups Projects
Commit d0dc3621 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Merge branch 'fix-preferences-migration' into 'master'

Use correct preference model and update AlekSIS-Core

See merge request !130
parents 74c06092 cb4dc947
No related branches found
No related tags found
1 merge request!130Use correct preference model and update AlekSIS-Core
Pipeline #173578 passed with warnings
Pipeline: AlekSIS

#173581

    ...@@ -12,7 +12,7 @@ def _setting_name_old(model, field): ...@@ -12,7 +12,7 @@ def _setting_name_old(model, field):
    def _migrate_preferences(apps, schema_editor): def _migrate_preferences(apps, schema_editor):
    SitePreferenceModel = apps.get_model("core", "SitePreferenceModel") GlobalPreferenceModel = apps.get_model("dynamic_preferences", "GlobalPreferenceModel")
    for field in Person.syncable_fields(): for field in Person.syncable_fields():
    old_setting_name = _setting_name_old(Person, field) old_setting_name = _setting_name_old(Person, field)
    ...@@ -20,7 +20,7 @@ def _migrate_preferences(apps, schema_editor): ...@@ -20,7 +20,7 @@ def _migrate_preferences(apps, schema_editor):
    for suffix in _preference_suffixes: for suffix in _preference_suffixes:
    old_pref_name = old_setting_name + suffix old_pref_name = old_setting_name + suffix
    new_pref_name = setting_name + suffix new_pref_name = setting_name + suffix
    SitePreferenceModel.objects.filter(section="ldap", name=old_pref_name).update(name=new_pref_name) GlobalPreferenceModel.objects.filter(section="ldap", name=old_pref_name).update(name=new_pref_name)
    class Migration(migrations.Migration): class Migration(migrations.Migration):
    ......
    ...@@ -43,7 +43,7 @@ priority = "supplemental" ...@@ -43,7 +43,7 @@ priority = "supplemental"
    [tool.poetry.dependencies] [tool.poetry.dependencies]
    python = "^3.10" python = "^3.10"
    django-ldapdb = "^1.4.0" django-ldapdb = "^1.4.0"
    aleksis-core = {version = "^4.0.0.dev3", extras = ["ldap"]} aleksis-core = {version = "^4.0.0.dev5", extras = ["ldap"]}
    python-magic = "^0.4.22" python-magic = "^0.4.22"
    [tool.poetry.plugins."aleksis.app"] [tool.poetry.plugins."aleksis.app"]
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment