Skip to content

Commit 76f9fdf

Browse files
authored
When unlocking a hint, always use an accounts true score and not their public visible score (CTFd#2441)
* When unlocking a hint, always use an accounts true score and not their publicly visible score
1 parent d39a0fc commit 76f9fdf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CTFd/api/v1/unlocks.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def post(self):
109109

110110
# We should use the team's score if in teams mode
111111
# user.account gives the appropriate account based on team mode
112-
if target.cost > user.account.score:
112+
# Use get_score with admin to get the account's full score value
113+
if target.cost > user.account.get_score(admin=True):
113114
return (
114115
{
115116
"success": False,

0 commit comments

Comments
 (0)