diff --git a/src/open_inwoner/conf/base.py b/src/open_inwoner/conf/base.py index d42be55b01..f88416a295 100644 --- a/src/open_inwoner/conf/base.py +++ b/src/open_inwoner/conf/base.py @@ -609,6 +609,11 @@ ADMIN_INDEX_SHOW_REMAINING_APPS = False ADMIN_INDEX_AUTO_CREATE_APP_GROUP = False ADMIN_INDEX_SHOW_REMAINING_APPS_TO_SUPERUSERS = False +ADMIN_INDEX_SHOW_MENU = True +ADMIN_INDEX_DISPLAY_DROP_DOWN_MENU_CONDITION_FUNCTION = ( + "open_inwoner.utils.django_two_factor_auth.should_display_dropdown_menu" +) + # # DJANGO-AXES (4.0+) diff --git a/src/open_inwoner/utils/django_two_factor_auth.py b/src/open_inwoner/utils/django_two_factor_auth.py index 1e3dc9688b..dcb6a17fe7 100644 --- a/src/open_inwoner/utils/django_two_factor_auth.py +++ b/src/open_inwoner/utils/django_two_factor_auth.py @@ -8,8 +8,7 @@ def should_display_dropdown_menu(request) -> bool: default = default_should_display_dropdown_menu(request) - two_factor_enabled = settings.TWO_FACTOR_PATCH_ADMIN - if not two_factor_enabled: + if settings.DISABLE_2FA: return default # never display the dropdown in two-factor admin views