X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/4bbb2156110a75e84ef95ee28ba31490d986b870..577d5301bc90f71afdcd82ca62bd711351dbfa73:/forum/views/users.py diff --git a/forum/views/users.py b/forum/views/users.py index c6fae00..adf9b59 100644 --- a/forum/views/users.py +++ b/forum/views/users.py @@ -211,6 +211,11 @@ def award_points(request, id): except: raise decorators.CommandException(_("Invalid number of points to award.")) + awarding_user = get_object_or_404(User, id=request.user.pk) + + if points > awarding_user.reputation: + raise decorators.CommandException(_("Invalid number of points to award.")) + user = get_object_or_404(User, id=id) extra = dict(message=request.POST.get('message', ''), awarding_user=request.user.id, value=points)