Merge pull request #30 from Payphone-Bot/29-first-call-message-being-censored-is-making-calls-crashing-phistory
29 first call message being censored is making calls crashing phistory
This commit is contained in:
@@ -303,6 +303,7 @@ class Users(base.Cog):
|
|||||||
|
|
||||||
min_ids = await (
|
min_ids = await (
|
||||||
models.Message.filter(call_id__in=call_ids)
|
models.Message.filter(call_id__in=call_ids)
|
||||||
|
.exclude(propagation_id=None)
|
||||||
.annotate(min_id=functions.Min("id"))
|
.annotate(min_id=functions.Min("id"))
|
||||||
.group_by("call_id")
|
.group_by("call_id")
|
||||||
.values_list("min_id", flat=True)
|
.values_list("min_id", flat=True)
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ from payphone.core import config
|
|||||||
async def init() -> None:
|
async def init() -> None:
|
||||||
"""Initialize the database and it's connections."""
|
"""Initialize the database and it's connections."""
|
||||||
|
|
||||||
await tortoise.Tortoise.close_connections()
|
|
||||||
|
|
||||||
await tortoise.Tortoise.init(config.TORTOISE_ORM, use_tz=True)
|
await tortoise.Tortoise.init(config.TORTOISE_ORM, use_tz=True)
|
||||||
|
|
||||||
await tortoise.Tortoise.generate_schemas(safe=True)
|
await tortoise.Tortoise.generate_schemas(safe=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user