Skip to content

Commit 84b2291

Browse files
committed
Fix error checking in mastodon pinning looking at the wrong object
1 parent 67562e6 commit 84b2291

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pgweb/util/socialposter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ def set_pin(self, postid):
8080
headers={'Authorization': 'Bearer {}'.format(self.settings.MASTODON_TOKEN)},
8181
timeout=10,
8282
)
83-
if r.status_code != 200:
84-
print("Failed to unpin from mastodon: {}".format(r.text))
83+
if r2.status_code != 200:
84+
print("Failed to unpin from mastodon: {}".format(r2.text))
8585

8686
if not found:
8787
# Not already pinned, so pin!
@@ -90,8 +90,8 @@ def set_pin(self, postid):
9090
headers={'Authorization': 'Bearer {}'.format(self.settings.MASTODON_TOKEN)},
9191
timeout=10,
9292
)
93-
if r.status_code != 200:
94-
print("Failed to pin to mastodon: {}".format(r.text))
93+
if r2.status_code != 200:
94+
print("Failed to pin to mastodon: {}".format(r2.text))
9595
return False
9696

9797
return True

0 commit comments

Comments
 (0)