[mastodon] Fix delete endpoint for mastodon
This commit is contained in:
parent
9c7607b7ca
commit
d897f369f7
|
@ -101,6 +101,12 @@ async def mastodon_read_all(hood=Depends(get_hood)):
|
||||||
)
|
)
|
||||||
async def mastodon_delete(mastodon=Depends(get_mastodon)):
|
async def mastodon_delete(mastodon=Depends(get_mastodon)):
|
||||||
spawner.stop(mastodon)
|
spawner.stop(mastodon)
|
||||||
|
await mastodon.instance.load()
|
||||||
|
object_with_instance = await MastodonAccount.objects.filter(
|
||||||
|
instance=mastodon.instance
|
||||||
|
).all()
|
||||||
|
if len(object_with_instance) == 1 and object_with_instance[0] == mastodon:
|
||||||
|
await mastodon.instance.delete()
|
||||||
await mastodon.delete()
|
await mastodon.delete()
|
||||||
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue