mirror of https://gitlab.com/bashrc2/epicyon
Check that lists exist before adding header
parent
48c298f5f8
commit
8de2a24235
|
@ -1675,10 +1675,7 @@ def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
|
||||||
'userAgentsBlockedStr', userAgentsBlockedStr,
|
'userAgentsBlockedStr', userAgentsBlockedStr,
|
||||||
200, '', False)
|
200, '', False)
|
||||||
|
|
||||||
idx = 'Add content warnings for the following sites'
|
CWlistsStr = ''
|
||||||
editProfileForm += \
|
|
||||||
'<label class="labels">' + translate[idx] + ':</label>\n'
|
|
||||||
|
|
||||||
for listName, item in CWlists.items():
|
for listName, item in CWlists.items():
|
||||||
name = listName
|
name = listName
|
||||||
variableName = 'list' + name.replace(' ', '').replace("'", '')
|
variableName = 'list' + name.replace(' ', '').replace("'", '')
|
||||||
|
@ -1688,7 +1685,12 @@ def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
|
||||||
listIsEnabled = False
|
listIsEnabled = False
|
||||||
if translate.get(name):
|
if translate.get(name):
|
||||||
name = translate[name]
|
name = translate[name]
|
||||||
editProfileForm += editCheckBox(name, variableName, listIsEnabled)
|
CWlistsStr += editCheckBox(name, variableName, listIsEnabled)
|
||||||
|
if CWlistsStr:
|
||||||
|
idx = 'Add content warnings for the following sites'
|
||||||
|
editProfileForm += \
|
||||||
|
'<label class="labels">' + translate[idx] + ':</label>\n' + \
|
||||||
|
CWlistsStr
|
||||||
|
|
||||||
editProfileForm += endEditSection()
|
editProfileForm += endEditSection()
|
||||||
return editProfileForm
|
return editProfileForm
|
||||||
|
|
Loading…
Reference in New Issue