tasks: skip deleted subtasks in notifications

parent 82dd51f6
......@@ -19,16 +19,16 @@ ACL_NOTIFY_STATES = {
def _format_subtasks(subtasks: dict) -> str:
if not subtasks:
active = {num: sub for num, sub in subtasks.items() if sub.pkgname}
if not active:
return ""
max_num_len = max(len(num) for num in subtasks)
max_num_len = max(len(num) for num in active)
lines = []
for num, sub in subtasks.items():
for num, sub in active.items():
padded = num + " " * (max_num_len - len(num))
name = sub.pkgname or "unknown"
version = f"{sub.version}-{sub.release}" if sub.version and sub.release else ""
entry = f"{name}/{version}" if version else name
entry = f"{sub.pkgname}/{version}" if version else sub.pkgname
lines.append(f"{HTMLFormatter(code_inline(padded))} | {entry}")
return "\n".join(lines)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment