From 4f575e8316b01673bf858122171f0d90b78d7b9d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 30 Jun 2021 14:01:51 +0100 Subject: [PATCH] Getting petname --- petnames.py | 6 ++++++ webapp_person_options.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/petnames.py b/petnames.py index 2378c9047..fb11d2087 100644 --- a/petnames.py +++ b/petnames.py @@ -75,6 +75,12 @@ def getPetName(baseDir: str, nickname: str, domain: str, for pet in petnamesList: if pet.endswith(' ' + handle): return pet.replace(' ' + handle, '').strip() + elif ' ' + handle.lower() + '\n' in petnamesStr.lower(): + petnamesList = petnamesStr.split('\n') + handle = handle.lower() + for pet in petnamesList: + if pet.endswith(' ' + handle): + return pet.replace(' ' + handle, '').strip() return '' diff --git a/webapp_person_options.py b/webapp_person_options.py index 35ac8708e..6b55aafd8 100644 --- a/webapp_person_options.py +++ b/webapp_person_options.py @@ -235,7 +235,7 @@ def htmlPersonOptions(defaultTimeline: str, if authorized: if originPathStr == '/users/' + nickname: if optionsNickname: - handle = optionsNickname + '@' + optionsDomainFull + # handle = optionsNickname + '@' + optionsDomainFull petname = getPetName(baseDir, nickname, domain, handle) optionsStr += \ ' ' + translate['Petname'] + ': \n' + \