Skip to content
Snippets Groups Projects
Commit 371ecff9 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

bugfix when not user preference class is defined

parent b47e60e4
No related branches found
Tags 7.8.0
No related merge requests found
Pipeline #146257 passed with stages
in 2 minutes and 5 seconds
......@@ -55,7 +55,11 @@ class UserPreferencesAdmin(admin.ModelAdmin):
"user",
]
]
filter_horizontal = [field.name for field in get_user_preference_class()._meta.get_fields() if field.many_to_many]
filter_horizontal = [field.name for field in (
[]
if get_user_preference_class() is None
else get_user_preference_class()._meta.get_fields()
) if field.many_to_many]
def username(self, obj):
return mark_safe("<i>default preferences</i>") if obj.user is None else obj.user
......
[metadata]
name = django-basetheme-bootstrap
version = 1.8.5
version = 1.8.6
description = Django Basetheme Bootstrap
long_description = file: README.rst
url = https://gitlab.pasteur.fr/bbrancot/django-basetheme-bootstrap
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment