chore: format
This commit is contained in:
@@ -153,15 +153,11 @@ class AutomationTable:
|
||||
row = await db.get(Automation, id)
|
||||
return AutomationModel.model_validate(row) if row else None
|
||||
|
||||
async def get_active_by_user(
|
||||
self, user_id: str, db: Optional[AsyncSession] = None
|
||||
) -> list[AutomationModel]:
|
||||
async def get_active_by_user(self, user_id: str, db: Optional[AsyncSession] = None) -> list[AutomationModel]:
|
||||
"""Get active automations for a user (for calendar RRULE expansion)."""
|
||||
async with get_async_db_context(db) as db:
|
||||
result = await db.execute(
|
||||
select(Automation)
|
||||
.filter_by(user_id=user_id, is_active=True)
|
||||
.order_by(Automation.created_at.desc())
|
||||
select(Automation).filter_by(user_id=user_id, is_active=True).order_by(Automation.created_at.desc())
|
||||
)
|
||||
return [AutomationModel.model_validate(r) for r in result.scalars().all()]
|
||||
|
||||
@@ -291,9 +287,8 @@ class AutomationTable:
|
||||
timezone_by_user_id: dict[str, Optional[str]] = {}
|
||||
if user_ids:
|
||||
from open_webui.models.users import User
|
||||
tz_result = await db.execute(
|
||||
select(User.id, User.timezone).where(User.id.in_(user_ids))
|
||||
)
|
||||
|
||||
tz_result = await db.execute(select(User.id, User.timezone).where(User.id.in_(user_ids)))
|
||||
timezone_by_user_id = {uid: tz for uid, tz in tz_result.all()}
|
||||
|
||||
for row in rows:
|
||||
|
||||
Reference in New Issue
Block a user