root: skip check for formdefs using tracking code when unnecessary (#22071)

This commit is contained in:
Frédéric Péters 2018-02-23 09:28:47 +01:00
parent 6f738411eb
commit dadd54bca8
1 changed files with 3 additions and 2 deletions

View File

@ -1097,8 +1097,9 @@ class AlternateRootDirectory(OldRootDirectory):
r = TemplateIO(html=True)
root_url = get_publisher().get_root_url()
if self.has_anonymous_access_codes() and path == [''] and (
'include-tracking-code-form' in get_response().filter.get('keywords', [])):
if (path == [''] and
'include-tracking-code-form' in get_response().filter.get('keywords', []) and
self.has_anonymous_access_codes()):
r += htmltext('<form id="follow-form" action="%scode/load">') % root_url
r += htmltext('<h3>%s</h3>') % _('Tracking code')
r += htmltext('<input size="12" name="code" placeholder="%s"/>') % _('ex: RPQDFVCD')