From fc149e2ce9541e0c365ff6f44b9243b8ee133e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 27 Nov 2018 09:13:36 +0100 Subject: [PATCH] misc: add count of visible blocks to login view context (#28370) --- src/authentic2/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/authentic2/views.py b/src/authentic2/views.py index 13c96d0f..478bdb02 100644 --- a/src/authentic2/views.py +++ b/src/authentic2/views.py @@ -365,6 +365,7 @@ def login(request, template_name='authentic2/login.html', 'methods': rendered_forms, # new definition 'blocks': collections.OrderedDict((block['id'], block) for block in blocks), + 'visible_blocks_count': len([x for x in blocks if not x['is_hidden']]), redirect_field_name: redirect_to, }) return render(request, template_name, context) -- 2.20.0.rc1