refac
This commit is contained in:
1 parent
0576e8eeb5
commit
f1409266fe
8 files changed
+33
-33
No files matched your search
@@ -241,11 +241,11 @@ class CalendarTable:
|
||||
access_grants: Optional[list[AccessGrantModel]] = None,
|
||||
db: Optional[AsyncSession] = None,
|
||||
) -> CalendarModel:
|
||||
cal_data = CalendarModel.model_validate(cal).model_dump(exclude={'access_grants'})
|
||||
cal_data['access_grants'] = (
|
||||
access_grants if access_grants is not None else await self._get_access_grants(cal_data['id'], db=db)
|
||||
calendar_model = CalendarModel.model_validate(cal)
|
||||
calendar_model.access_grants = (
|
||||
access_grants if access_grants is not None else await self._get_access_grants(calendar_model.id, db=db)
|
||||
)
|
||||
return CalendarModel.model_validate(cal_data)
|
||||
return calendar_model
|
||||
|
||||
async def get_or_create_defaults(self, user_id: str, db: Optional[AsyncSession] = None) -> list[CalendarModel]:
|
||||
"""Return user's calendars, creating 'Personal' default if none exist."""
|
||||
|
||||
Reference in new issue
Block a user