feat: claim work from unread updates (#321)
This commit is contained in:
1 parent
d6c7a495ed
commit
0ea264a942
11 files changed
+244
-7
No files matched your search
@@ -680,6 +680,21 @@ async def notification_detail(thread_id: int) -> dict:
|
||||
latest_url = _safe_web_url(comment.get("html_url")) or _safe_web_url(
|
||||
subject.get("latest_comment_html_url")
|
||||
)
|
||||
assignee_values = subject_detail.get("assignees")
|
||||
assignees = [
|
||||
value.get("login")
|
||||
for value in (assignee_values if isinstance(assignee_values, list) else [])
|
||||
if isinstance(value, dict) and isinstance(value.get("login"), str)
|
||||
]
|
||||
issue = {
|
||||
"number": subject_detail.get("number"),
|
||||
"assignees": assignees,
|
||||
"claimable": (
|
||||
subject.get("type") == "Issue"
|
||||
and subject_detail.get("state", subject.get("state")) == "open"
|
||||
and not assignees
|
||||
),
|
||||
} if supported_conversation and subject.get("type") == "Issue" else None
|
||||
return {
|
||||
"id": thread_id,
|
||||
"repository": repository.get("full_name", "")
|
||||
@@ -710,6 +725,7 @@ async def notification_detail(thread_id: int) -> dict:
|
||||
else "",
|
||||
"url": latest_url,
|
||||
},
|
||||
"issue": issue,
|
||||
"conversation": conversation,
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1587,7 +1587,7 @@ async def claim_available_issue(
|
||||
)
|
||||
except gitea_proxy.IssueNotAvailableError:
|
||||
return JSONResponse(
|
||||
{"error": "This issue was already claimed or is no longer open. Refresh Find Work."},
|
||||
{"error": "This issue was already claimed or is no longer open."},
|
||||
status_code=409,
|
||||
)
|
||||
except Exception:
|
||||
|
||||
Reference in new issue
Block a user