Check that message has a translation

merge-requests/30/head
Bob Mottram 2024-02-15 21:50:59 +00:00
parent bc94befc37
commit 4e78dcf9fe
1 changed files with 4 additions and 1 deletions

View File

@ -1001,7 +1001,10 @@ class PubServer(BaseHTTPRequestHandler):
def _401(self, post_msg: str) -> None:
if self.server.translate:
ok_str = self.server.translate[post_msg]
if self.server.translate.get(post_msg):
ok_str = self.server.translate[post_msg]
else:
ok_str = post_msg
self._http_return_code(401, self.server.translate['Unauthorized'],
ok_str, None)
else: