Skip to content

Commit dd511ea

Browse files
ShudelEVEvgeni Shudel
andauthored
fix: checkpreferences command failed if MANAGER_ATTRIBUTE is changed (#258)
Co-authored-by: Evgeni Shudel <[email protected]>
1 parent ba4305d commit dd511ea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dynamic_preferences/management/commands/checkpreferences.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from dynamic_preferences.models import GlobalPreferenceModel
44
from dynamic_preferences.registries import (global_preferences_registry,
55
preference_models)
6+
from dynamic_preferences.settings import preferences_settings
67

78

89
def delete_preferences(queryset):
@@ -77,4 +78,4 @@ def handle(self, *args, **options):
7778
)
7879
self.stdout.write(message)
7980
for instance in preference_model.get_instance_model().objects.all():
80-
instance.preferences.all()
81+
getattr(instance, preferences_settings.MANAGER_ATTRIBUTE).all()

0 commit comments

Comments
 (0)