Updating enabled cw lists

merge-requests/30/head
Bob Mottram 2021-10-21 20:45:39 +01:00
parent 2ad58b798e
commit 88c4b14ca3
2 changed files with 28 additions and 27 deletions

View File

@ -5696,9 +5696,7 @@ class PubServer(BaseHTTPRequestHandler):
except BaseException: except BaseException:
pass pass
# save blocked user agents if isModerator(self.server.baseDir, nickname):
# This is admin lebel and global to the instance
if path.startswith('/users/' + adminNickname + '/'):
# set selected content warning lists # set selected content warning lists
newListsEnabled = '' newListsEnabled = ''
for name, item in self.server.CWlists.items(): for name, item in self.server.CWlists.items():
@ -5715,6 +5713,7 @@ class PubServer(BaseHTTPRequestHandler):
"listsEnabled", "listsEnabled",
newListsEnabled) newListsEnabled)
# save blocked user agents
userAgentsBlocked = [] userAgentsBlocked = []
if fields.get('userAgentsBlockedStr'): if fields.get('userAgentsBlockedStr'):
userAgentsBlockedStr = \ userAgentsBlockedStr = \

View File

@ -34,6 +34,7 @@ from person import personBoxJson
from person import getActorJson from person import getActorJson
from person import getPersonAvatarUrl from person import getPersonAvatarUrl
from webfinger import webfingerHandle from webfinger import webfingerHandle
from posts import isModerator
from posts import parseUserFeed from posts import parseUserFeed
from posts import getPersonBox from posts import getPersonBox
from posts import isCreateInsideAnnounce from posts import isCreateInsideAnnounce
@ -1667,6 +1668,7 @@ def _htmlEditProfileFiltering(baseDir: str, nickname: str, domain: str,
'style="height:200px" spellcheck="false">' + \ 'style="height:200px" spellcheck="false">' + \
allowedInstancesStr + '</textarea>\n' allowedInstancesStr + '</textarea>\n'
if isModerator(baseDir, nickname):
userAgentsBlockedStr = '' userAgentsBlockedStr = ''
for ua in userAgentsBlocked: for ua in userAgentsBlocked:
if userAgentsBlockedStr: if userAgentsBlockedStr: