fixing import error

master
b3yond 2019-05-17 20:42:13 +02:00
parent 079166e74c
commit 8c778927ee
1 changed files with 4 additions and 4 deletions

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: