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

Merge branch 'master' into 639-fieldinstancetracker-object-has-no-attribute-saved_data

parents b94fb235 1ff8e967
No related branches found
No related tags found
1 merge request!948Resolve "'FieldInstanceTracker' object has no attribute 'saved_data'"
Pipeline #52906 passed with warnings
......@@ -12,6 +12,7 @@ Unreleased
Fixed
~~~~~
* Migration added in 2.7.2 did not work in all scenarios
* [Dev] Field change tracking API for Person was broken in 2.7.2
`2.7.2`_ - 2022-01-31
......
......@@ -12,11 +12,7 @@ class Migration(migrations.Migration):
]
def _migrate_preference_models_to_unique(apps, schema_editor):
GroupPreferenceModel = apps.get_model("core", "GroupPreferenceModel")
PersonPreferenceModel = apps.get_model("core", "PersonPreferenceModel")
SitePreferenceModel = apps.get_model("core", "SitePreferenceModel")
from dynamic_preferences.models import BasePreferenceModel
from aleksis.core.models import GroupPreferenceModel, PersonPreferenceModel, SitePreferenceModel
models = [GroupPreferenceModel, PersonPreferenceModel, SitePreferenceModel]
......@@ -32,7 +28,7 @@ class Migration(migrations.Migration):
if len(objs) > 1:
found = False
for obj in objs:
if BasePreferenceModel.get_value(obj) == BasePreferenceModel.preference(obj).default or found:
if obj.value == obj.preference.default or found:
obj.delete()
else:
found = True
......
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