From 8161af27950b058b0d41535f46913c6c0369c0ac Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 1 Dec 2020 09:58:21 +0000 Subject: [PATCH] Tidying --- webapp_post.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/webapp_post.py b/webapp_post.py index 7a3ed4dd..4bbe0050 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -307,19 +307,22 @@ def getEditIconHtml(baseDir: str, nickname: str, domainFull: str, """Returns html for the edit icon/button """ editStr = '' - if (postJsonObject['actor'].endswith(domainFull + '/users/' + nickname) or + actor = postJsonObject['actor'] + if (actor.endswith(domainFull + '/users/' + nickname) or (isEditor(baseDir, nickname) and - postJsonObject['actor'].endswith(domainFull + '/users/news'))): - if '/statuses/' in postJsonObject['object']['id']: + actor.endswith(domainFull + '/users/news'))): + + postId = postJsonObject['object']['id'] + + if '/statuses/' in postId: if isBlogPost(postJsonObject): - blogPostId = postJsonObject['object']['id'] if not isNewsPost(postJsonObject): editStr += \ ' ' + \ '' + \ '' + \ '\n' elif isEvent: - eventPostId = postJsonObject['object']['id'] editStr += \ ' ' + \ '' + \ '