refactor: enhance code comments for clarity and maintainability across multiple files
This commit is contained in:
@@ -149,6 +149,8 @@ async def build_board_snapshot(session: AsyncSession, board: Board) -> BoardSnap
|
||||
approval_ids=approval_ids,
|
||||
)
|
||||
task_title_by_id = {task.id: task.title for task in tasks}
|
||||
# Hydrate each approval with linked task metadata, falling back to legacy
|
||||
# single-task fields so older rows still render complete approval cards.
|
||||
approval_reads = [
|
||||
_approval_to_read(
|
||||
approval,
|
||||
|
||||
@@ -175,6 +175,8 @@ async def accept_invite(
|
||||
session.add(member)
|
||||
await session.flush()
|
||||
|
||||
# For scoped invites, copy invite board-access rows onto the member at accept
|
||||
# time so effective permissions survive invite lifecycle cleanup.
|
||||
if not (invite.all_boards_read or invite.all_boards_write):
|
||||
access_rows = list(
|
||||
await session.exec(
|
||||
|
||||
@@ -164,7 +164,8 @@ async def validate_dependency_update(
|
||||
},
|
||||
)
|
||||
|
||||
# Ensure the dependency graph is acyclic after applying the update.
|
||||
# Rebuild the board-wide graph and overlay the pending edit for this task so
|
||||
# validation catches indirect cycles created through existing edges.
|
||||
task_ids = list(
|
||||
await session.exec(
|
||||
select(col(Task.id)).where(col(Task.board_id) == board_id),
|
||||
|
||||
Reference in New Issue
Block a user