misc: add count of visible blocks to login view context (#28370)

This commit is contained in:
Frédéric Péters 2018-11-27 09:13:36 +01:00
parent 0876d25dbd
commit df9e4d5236
1 changed files with 1 additions and 0 deletions

View File

@ -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)