Merge pull request #96 from ticketfrei/master

2.1.4 Release
This commit is contained in:
b3yond 2019-05-17 20:55:35 +02:00 committed by GitHub
commit d60ec173ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,7 @@
from bot import Bot
import logging
from mastodon import Mastodon, MastodonServerError
import mastodon
import re
from report import Report
@ -19,13 +19,13 @@ class MastodonBot(Bot):
"""
mentions = []
try:
m = Mastodon(*user.get_masto_credentials())
m = mastodon.Mastodon(*user.get_masto_credentials())
except TypeError:
# logger.error("No Mastodon Credentials in database.", exc_info=True)
return mentions
try:
notifications = m.notifications()
except MastodonServerError:
except mastodon.MastodonServerError:
logger.error("Unknown Mastodon API Error: 502")
return mentions
for status in notifications:
@ -54,7 +54,7 @@ class MastodonBot(Bot):
def post(self, user, report):
try:
m = Mastodon(*user.get_masto_credentials())
m = mastodon.Mastodon(*user.get_masto_credentials())
except TypeError:
return # no mastodon account for this user.
if report.source == self: