From da4ee4021afae4a98173ed33b15efc997c402b68 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Mon, 23 Nov 2020 13:10:35 -0500 Subject: [PATCH] Fix issue where a user can't be found for creating an award (#1736) * Fix issue where a user can't be found for creating an award --- CTFd/api/v1/awards.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CTFd/api/v1/awards.py b/CTFd/api/v1/awards.py index 1ecf80f5..77531a9a 100644 --- a/CTFd/api/v1/awards.py +++ b/CTFd/api/v1/awards.py @@ -105,7 +105,7 @@ class AwardList(Resource): if is_teams_mode(): team_id = req.get("team_id") if team_id is None: - user = Users.query.filter_by(id=req["user_id"]).first() + user = Users.query.filter_by(id=req["user_id"]).first_or_404() if user.team_id is None: return ( {