show opus submissions for admin
This commit is contained in:
@@ -25,6 +25,7 @@ from .schemas import (
|
||||
SubmissionOut,
|
||||
PuzzleResponseOut,
|
||||
ValidationIn,
|
||||
SubmissionFileOut,
|
||||
SteamCollectionItemOut,
|
||||
SteamCollectionOut,
|
||||
)
|
||||
@@ -302,6 +303,24 @@ def list_responses_needing_validation(request, event_path: str):
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
f"{PREFIX}/responses/{{response_id}}/files",
|
||||
response={200: List[SubmissionFileOut], 403: dict},
|
||||
)
|
||||
@decorate_view(require_game_enabled(OPUS_MAGNUM_APP_ID))
|
||||
def list_response_files(request, event_path: str, response_id: int):
|
||||
"""Get the solution files of any player's response (admin only)"""
|
||||
|
||||
if not request.user.is_authenticated or not request.user.is_staff:
|
||||
return 403, {"detail": "Admin access required"}
|
||||
|
||||
response = get_object_or_404(
|
||||
PuzzleResponse, id=response_id, submission__event=request.event
|
||||
)
|
||||
|
||||
return response.files.all()
|
||||
|
||||
|
||||
@router.post(
|
||||
f"{PREFIX}/submissions/{{submission_id}}/validate",
|
||||
response={200: SubmissionOut, 403: dict},
|
||||
|
||||
Reference in New Issue
Block a user