Add Mastodon bot to Ticketfrei 3 #2

Merged
missytake merged 32 commits from mastodon into development 2023-03-19 19:31:03 +00:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit a61c48e99e - Show all commits

View file

@ -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):

View file

@ -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(