From 808495f2b967e1bf449aa9a72ff926eecb96c9d5 Mon Sep 17 00:00:00 2001 From: Anatol Coen Date: Sun, 19 May 2024 22:35:04 +1200 Subject: [PATCH] Make error message match format of other error messages --- app/controllers/problems_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/problems_controller.rb b/app/controllers/problems_controller.rb index fa12386d..02f09b60 100644 --- a/app/controllers/problems_controller.rb +++ b/app/controllers/problems_controller.rb @@ -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