@@ -106,7 +106,7 @@ def _if_video_validation_enabled(self, user: User) -> bool | None:
106106 @staticmethod
107107 async def _get_summary_from_progress_stream (
108108 session_ids : list [str ],
109- user_id : int ,
109+ user : User ,
110110 team : Team ,
111111 min_timestamp : datetime ,
112112 max_timestamp : datetime ,
@@ -117,7 +117,7 @@ async def _get_summary_from_progress_stream(
117117 results : list [tuple [SessionSummaryStreamUpdate , tuple [EnrichedSessionGroupSummaryPatternsList , str ] | str ]] = []
118118 async for update in execute_summarize_session_group (
119119 session_ids = session_ids ,
120- user_id = user_id ,
120+ user = user ,
121121 team = team ,
122122 min_timestamp = min_timestamp ,
123123 max_timestamp = max_timestamp ,
@@ -171,7 +171,7 @@ def create_session_summaries(self, request: Request, **kwargs) -> Response:
171171 try :
172172 summary = async_to_sync (self ._get_summary_from_progress_stream )(
173173 session_ids = session_ids ,
174- user_id = user . id ,
174+ user = user ,
175175 team = self .team ,
176176 min_timestamp = min_timestamp ,
177177 max_timestamp = max_timestamp ,
@@ -217,15 +217,15 @@ def create_session_summaries(self, request: Request, **kwargs) -> Response:
217217 @staticmethod
218218 async def _summarize_session (
219219 session_id : str ,
220- user_id : int ,
220+ user : User ,
221221 team : Team ,
222222 video_validation_enabled : bool | None ,
223223 extra_summary_context : ExtraSummaryContext | None = None ,
224224 ) -> SessionSummarySerializer | Exception :
225225 try :
226226 summary_raw = await execute_summarize_session (
227227 session_id = session_id ,
228- user_id = user_id ,
228+ user = user ,
229229 team = team ,
230230 video_validation_enabled = video_validation_enabled ,
231231 extra_summary_context = extra_summary_context ,
@@ -240,7 +240,7 @@ async def _summarize_session(
240240 async def _get_individual_summaries (
241241 self ,
242242 session_ids : list [str ],
243- user_id : int ,
243+ user : User ,
244244 team : Team ,
245245 video_validation_enabled : bool | None ,
246246 extra_summary_context : ExtraSummaryContext | None = None ,
@@ -251,7 +251,7 @@ async def _get_individual_summaries(
251251 tasks [session_id ] = tg .create_task (
252252 self ._summarize_session (
253253 session_id = session_id ,
254- user_id = user_id ,
254+ user = user ,
255255 team = team ,
256256 video_validation_enabled = video_validation_enabled ,
257257 extra_summary_context = extra_summary_context ,
@@ -262,9 +262,9 @@ async def _get_individual_summaries(
262262 res : SessionSummarySerializer | Exception = task .result ()
263263 if isinstance (res , Exception ):
264264 logger .exception (
265- f"Failed to generate individual session summary for session { session_id } from team { team .pk } by user { user_id } : { res } " ,
265+ f"Failed to generate individual session summary for session { session_id } from team { team .pk } by user { user . id } : { res } " ,
266266 team_id = team .pk ,
267- user_id = user_id ,
267+ user_id = user . id ,
268268 )
269269 else :
270270 # Return only successful summaries
@@ -296,7 +296,7 @@ def create_session_summaries_individually(self, request: Request, **kwargs) -> R
296296 try :
297297 summaries = async_to_sync (self ._get_individual_summaries )(
298298 session_ids = session_ids ,
299- user_id = user . id ,
299+ user = user ,
300300 team = self .team ,
301301 video_validation_enabled = video_validation_enabled ,
302302 extra_summary_context = extra_summary_context ,
0 commit comments