Sync #6
@ -39,7 +39,7 @@ async def remind(app: PyroClient) -> None:
|
|||||||
|
|
||||||
entries = await col_entries.find(
|
entries = await col_entries.find(
|
||||||
{
|
{
|
||||||
"locations": {"$in": location.id},
|
"locations": location.id,
|
||||||
"date": user_date.replace(hour=0, minute=0),
|
"date": user_date.replace(hour=0, minute=0),
|
||||||
}
|
}
|
||||||
).to_list()
|
).to_list()
|
||||||
|
@ -34,23 +34,15 @@ async def command_upcoming(app: PyroClient, message: Message):
|
|||||||
+ timedelta(days=30)
|
+ timedelta(days=30)
|
||||||
).replace(tzinfo=timezone.utc)
|
).replace(tzinfo=timezone.utc)
|
||||||
|
|
||||||
try:
|
entries = [
|
||||||
entries = [
|
await GarbageEntry.from_record(entry)
|
||||||
await GarbageEntry.from_record(entry)
|
async for entry in col_entries.find(
|
||||||
async for entry in col_entries.find(
|
{
|
||||||
{
|
"locations": user.location.id,
|
||||||
"locations": {"$in": user.location.id},
|
"date": {"$gte": date_min, "$lte": date_max},
|
||||||
"date": {"$gte": date_min, "$lte": date_max},
|
}
|
||||||
}
|
|
||||||
)
|
|
||||||
]
|
|
||||||
except OperationFailure:
|
|
||||||
await message.reply_text(
|
|
||||||
app._("upcoming_empty", "messages", locale=user.locale).format(
|
|
||||||
name=user.location.name
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
return
|
]
|
||||||
|
|
||||||
entries_text = "\n\n".join(
|
entries_text = "\n\n".join(
|
||||||
[
|
[
|
||||||
|
Reference in New Issue
Block a user