Skip to content

Commit

Permalink
Limit contents length in returned template
Browse files Browse the repository at this point in the history
  • Loading branch information
taoky committed Oct 29, 2024
1 parent b7abfe6 commit 82a001a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def post(self, request, challenge_id):
contents = request.POST.get("contents")
if len(contents) > 1024:
messages.error(request, "提交内容超过字数限制。")
return self.return_template(challenge_name, too_frequent, latest_feedback, contents)
return self.return_template(challenge_name, too_frequent, latest_feedback, contents[:1024])
user = User.get(Context.from_request(request), request.user.pk)
# send to user-defined endpoint
if settings.FEEDBACK_ENDPOINT:
Expand Down

0 comments on commit 82a001a

Please sign in to comment.