From 48d3235b8fff8ffabfc88abf2fef3c254da257ae Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 21 Oct 2021 20:03:26 +0100 Subject: [PATCH] Check that lists are enabled --- webapp_profile.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/webapp_profile.py b/webapp_profile.py index 9539f7a76..6b2af9093 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -1677,17 +1677,18 @@ def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str, 200, '', False) CWlistsStr = '' - print('CWlistsStr 0: ' + str(CWlists)) - for name, item in CWlists.items(): - print('CWlistsStr: ' + name) - variableName = 'list' + name.replace(' ', '').replace("'", '') - if name in listsEnabled: - listIsEnabled = True - else: - listIsEnabled = False - if translate.get(name): - name = translate[name] - CWlistsStr += editCheckBox(name, variableName, listIsEnabled) + if listsEnabled: + print('CWlistsStr 0: ' + str(CWlists)) + for name, item in CWlists.items(): + print('CWlistsStr: ' + name) + variableName = 'list' + name.replace(' ', '').replace("'", '') + if name in listsEnabled: + listIsEnabled = True + else: + listIsEnabled = False + if translate.get(name): + name = translate[name] + CWlistsStr += editCheckBox(name, variableName, listIsEnabled) if CWlistsStr: idx = 'Add content warnings for the following sites' editProfileForm += \