Skip to content

Commit

Permalink
Make error message match format of other error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
BelgianSalamander committed May 19, 2024
1 parent 320245e commit 808495f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/problems_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def submit
respond_to do |format|
source_is_valid = @submission.source.valid_encoding? && !@submission.source.include?("\0")
if !source_is_valid
@submission.errors.add :source_file, "- Submission has an invalid text encoding. This was likely caused by submitting a compiled file (.exe, .out, .class, ...) instead of a source code file (.cpp, .c, .java, ...)."
@submission.errors.add :source_file, "has an invalid text encoding. This was likely caused by submitting a compiled file (.exe, .out, .class, ...) instead of a source code file (.cpp, .c, .java, ...)."
@submission.source = nil; # Prevent submission form from trying to render the source (and erroring)
end

Expand Down

0 comments on commit 808495f

Please sign in to comment.