File tree Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change 11from asyncpg import Pool
2- from datetime import datetime
32
43
54class AcceptedSolution :
@@ -370,6 +369,40 @@ async def mark_as_solution(
370369 user_id ,
371370 )
372371
372+ async def update_user_mark_as_solution (
373+ self ,
374+ post_assist_id : int ,
375+ thread_id : int ,
376+ message_id : int ,
377+ user_id : int ,
378+ new_user_id : int ,
379+ ):
380+ """Marks a post as a solution."""
381+
382+ async with self ._pool .acquire () as conn :
383+ conn : Pool
384+
385+ await conn .execute (
386+ """
387+ UPDATE
388+ pph_post_assist_config_accept_solutions
389+ SET
390+ message_id = $1,
391+ user_id = $2
392+ WHERE
393+ post_assist_config_id = $3
394+ AND user_id = $4
395+ AND thread_id = $5;
396+ """ ,
397+ message_id ,
398+ new_user_id ,
399+ post_assist_id ,
400+ user_id ,
401+ thread_id ,
402+ )
403+
404+ return True
405+
373406 async def get_accepted_solution (self , thread_id : int ) -> AcceptedSolution | None :
374407 """Gets the accepted solution for a forum."""
375408
You can’t perform that action at this time.
0 commit comments