generated from coulomb/repo-seed
Candidate support/evidence acceptance
This commit is contained in:
@@ -1367,6 +1367,25 @@ def reject_candidate_evidence_from_form(
|
||||
)
|
||||
|
||||
|
||||
@router.post(
|
||||
"/ui/repos/{repository_id}/analysis-runs/{analysis_run_id}"
|
||||
"/candidate-evidence/{candidate_evidence_id}/accept"
|
||||
)
|
||||
def accept_candidate_evidence_from_form(
|
||||
repository_id: int,
|
||||
analysis_run_id: int,
|
||||
candidate_evidence_id: int,
|
||||
service: RegistryService = Depends(get_service),
|
||||
) -> RedirectResponse:
|
||||
service.accept_candidate_evidence(
|
||||
repository_id,
|
||||
analysis_run_id,
|
||||
candidate_evidence_id,
|
||||
notes="Accepted from web UI",
|
||||
)
|
||||
return RedirectResponse(f"/ui/repos/{repository_id}", status_code=303)
|
||||
|
||||
|
||||
@router.post(
|
||||
"/ui/repos/{repository_id}/analysis-runs/{analysis_run_id}"
|
||||
"/candidate-abilities/{candidate_ability_id}/edit"
|
||||
@@ -2376,6 +2395,10 @@ def render_candidate_support_element_actions(
|
||||
f"/ui/repos/{repository_id}/analysis-runs/{analysis_run_id}"
|
||||
f"/candidate-evidence/{item_id}/reject"
|
||||
)
|
||||
accept_action = (
|
||||
f"/ui/repos/{repository_id}/analysis-runs/{analysis_run_id}"
|
||||
f"/candidate-evidence/{item_id}/accept"
|
||||
)
|
||||
relink_action = (
|
||||
f"/ui/repos/{repository_id}/analysis-runs/{analysis_run_id}"
|
||||
f"/candidate-evidence/{item_id}/relink"
|
||||
@@ -2385,6 +2408,9 @@ def render_candidate_support_element_actions(
|
||||
f"/candidate-evidence/{item_id}/merge"
|
||||
)
|
||||
return f"""
|
||||
<form method="post" action="{accept_action}">
|
||||
<button type="submit">Accept</button>
|
||||
</form>
|
||||
<form method="post" action="{reject_action}">
|
||||
<button class="secondary" type="submit">Remove</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user