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 += \ ' ' + \ '' + \ '