X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/dcacc3b4c2ba2f550806a2d22b183f6fac4f63ff..a7918118f11ba4e856d06307f20aba6057552e07:/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)