Skip to content

Commit cb3171a

Browse files
committed
Fix contest new 404
1 parent 09dc1e5 commit cb3171a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

TODOLIST.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
- [ ] GitHub pipeline
12
- [ ] Modify rejudge behavior
23
- Lower priority
34
- Separate contest and non-contest submissions
45
- [ ] Virtual judge
56
- [ ] Batch upload testdata
67
- [ ] Revisit all JSON endpoints
7-
8-
8+
- [ ] Revisit all ActiveAdmin pages & Upgrade to ActiveAdmin 3
9+
---
910
- [ ] Cache computation-intensive results (AC count of problem (Redis) / user (DB))
1011
- [ ] Problem import & export
1112
- [ ] Native format
@@ -15,6 +16,7 @@
1516
- [ ] Judge load balancing
1617
- [ ] Write basic tests
1718
- [ ] Add more languages
19+
- [ ] Consider migrate to Trilogy
1820
- [ ] Send compiler information from judge server
1921
- [ ] Per-language memory/time limit / interactive lib
2022
- [ ] Role for problem setter

app/controllers/application_controller.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ def configure_permitted_parameters
106106
end
107107

108108
def set_layout_and_contest
109-
if /^\/contests\/./.match(request.fullpath)
109+
if /^\/contests\/./.match(request.fullpath) && !/^\/contests\/new\/?/.match(request.fullpath)
110+
# Use arbitrary character here instead of [0-9] to give proper 404 to requests such as /contests/abcde
111+
# However, we need to exclude /contests/new
110112
@layout = :contest
111113
elsif /^\/single_contest\/./.match(request.fullpath)
112114
@layout = :single_contest

0 commit comments

Comments
 (0)