Skip to content

Commit 886c618

Browse files
authored
Improve 403 and 500 error web pages (#2349)
* Improve 403 and 500 error web pages * Flake8 * Fix pages
1 parent 1c4e8c1 commit 886c618

6 files changed

Lines changed: 23 additions & 7 deletions

File tree

src/apps/pages/views.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from announcements.models import Announcement, NewsPost
77

88
from django.conf import settings
9-
from django.shortcuts import render
109
from utils.data import pretty_bytes
1110

1211

@@ -115,8 +114,3 @@ def get_context_data(self, *args, **kwargs):
115114

116115
class MonitorQueuesView(TemplateView):
117116
template_name = 'pages/monitor_queues.html'
118-
119-
120-
def page_not_found_view(request, exception):
121-
print(request)
122-
return render(request, '404.html', status=404)

src/static/img/403.png

2.95 KB
Loading

src/static/img/500.png

3.08 KB
Loading

src/templates/403.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% extends "base.html" %}
2+
3+
4+
{% block content %}
5+
<div class="sixteen wide mobile eight wide computer centered column">
6+
<img src="/static/img/403.png">
7+
<p>You do not have permission to access this page.</p>
8+
<p>If you believe this is an error, please fill a <a href="https://github.com/codalab/codabench/issues/new">bug report</a>. For more information about Codabench, check out the <a href="https://docs.codabench.org">docs</a>.</p>
9+
<a class="ui fluid blue submit button" href="/">Return to Home</a>
10+
</div>
11+
{% endblock %}

src/templates/404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<img src="/static/img/404.png">
77
<p>Could not find the page you requested.</p>
88
<p>If you are the challenge organizer and this URL previously pointed to a valid competition and it is now missing please contact us at info@codabench.org for more information.</p>
9-
<p> If this is an error, please file a <a href="https://github.com/codalab/codabench/issues/new">bug report</a>. For more information about Codabench, check out the <a href="https://docs.codabench.org">docs</a>.</p>
9+
<p>If this is an error, please fill a <a href="https://github.com/codalab/codabench/issues/new">bug report</a>. For more information about Codabench, check out the <a href="https://docs.codabench.org">docs</a>.</p>
1010
<a class="ui fluid blue submit button" href="/">Return to Home</a>
1111
</div>
1212
{% endblock %}

src/templates/500.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% extends "base.html" %}
2+
3+
4+
{% block content %}
5+
<div class="sixteen wide mobile eight wide computer centered column">
6+
<img src="/static/img/500.png">
7+
<p>Something went wrong on our end.</p>
8+
<p>If this is an error, please fill a <a href="https://github.com/codalab/codabench/issues/new">bug report</a>. For more information about Codabench, check out the <a href="https://docs.codabench.org">docs</a>.</p>
9+
<a class="ui fluid blue submit button" href="/">Return to Home</a>
10+
</div>
11+
{% endblock %}

0 commit comments

Comments
 (0)