diff --git a/backend/src/kibicara/platforms/mastodon/bot.py b/backend/src/kibicara/platforms/mastodon/bot.py index dad7de1..0fdad53 100644 --- a/backend/src/kibicara/platforms/mastodon/bot.py +++ b/backend/src/kibicara/platforms/mastodon/bot.py @@ -26,7 +26,7 @@ class MastodonBot(Censor): @classmethod async def destroy_hood(cls, hood): """Removes all its database entries.""" - for mastodon in await Mastodon.objects.filter(hood=hood).all(): + for mastodon in await MastodonAccount.objects.filter(hood=hood).all(): await mastodon.delete() async def run(self): diff --git a/backend/src/kibicara/platforms/mastodon/webapi.py b/backend/src/kibicara/platforms/mastodon/webapi.py index 8119297..c6dc386 100644 --- a/backend/src/kibicara/platforms/mastodon/webapi.py +++ b/backend/src/kibicara/platforms/mastodon/webapi.py @@ -14,7 +14,7 @@ from kibicara.platforms.mastodon.bot import spawner from kibicara.platforms.mastodon.model import MastodonAccount, MastodonInstance from kibicara.webapi.hoods import get_hood, get_hood_unauthorized -from mastodon import Mastodon, MastodonError, MastodonNetworkError +from mastodon import Mastodon, MastodonNetworkError from mastodon.errors import MastodonIllegalArgumentError from logging import getLogger @@ -173,7 +173,7 @@ async def mastodon_create(values: BodyMastodonAccount, hood=Depends(get_hood)): ) try: access_token = await get_event_loop().run_in_executor( - None, account.log_in, username, password + None, account.log_in, values.email, values.password ) logger.debug(f"{access_token}") mastodon = await MastodonAccount.objects.create(