From d2a4444c7e4c4413b0cd3b06b433099ee9bb904c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 21 Oct 2021 20:19:44 +0100 Subject: [PATCH] Tidying --- blocking.py | 6 ++++++ webapp_profile.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/blocking.py b/blocking.py index 0ba2d3623..67952d27b 100644 --- a/blocking.py +++ b/blocking.py @@ -959,3 +959,9 @@ def addCWfromLists(postJsonObject: {}, CWlists: {}, translate: {}, if cw: postJsonObject['object']['summary'] = cw postJsonObject['object']['sensitive'] = True + + +def getCWlistVariable(listName: str) -> str: + """Returns the variable associated with a CW list + """ + return 'list' + listName.replace(' ', '').replace("'", '') diff --git a/webapp_profile.py b/webapp_profile.py index 0f69b39fb..5617db465 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -69,6 +69,7 @@ from webapp_utils import endEditSection from blog import getBlogAddress from webapp_post import individualPostAsHtml from webapp_timeline import htmlIndividualShare +from blocking import getCWlistVariable def htmlProfileAfterSearch(cssCache: {}, @@ -1678,7 +1679,7 @@ def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str, CWlistsStr = '' for name, item in CWlists.items(): - variableName = 'list' + name.replace(' ', '').replace("'", '') + variableName = getCWlistVariable(name) listIsEnabled = False if listsEnabled: if name in listsEnabled: