diff --git a/src/apps/pages/views.py b/src/apps/pages/views.py index 971909972..e73c276b4 100644 --- a/src/apps/pages/views.py +++ b/src/apps/pages/views.py @@ -8,6 +8,8 @@ from competitions.models import Competition, Submission, CompetitionParticipant from profiles.models import User +from django.shortcuts import render + class HomeView(TemplateView): template_name = 'pages/home.html' @@ -62,3 +64,8 @@ def get_context_data(self, *args, **kwargs): context = super().get_context_data(*args, **kwargs) context['submissions'] = qs[:250] return context + + +def page_not_found_view(request, exception): + print(request) + return render(request, '404.html', status=404) diff --git a/src/static/img/404.png b/src/static/img/404.png new file mode 100644 index 000000000..510337e88 Binary files /dev/null and b/src/static/img/404.png differ diff --git a/src/templates/404.html b/src/templates/404.html new file mode 100644 index 000000000..ce2b6a226 --- /dev/null +++ b/src/templates/404.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + + +{% block content %} +
+ +

Could not find the page you requested.

+

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.

+

If this is an error, please file a bug report. For more information about Codabench, check out the wiki.

+ Return to Home +
+{% endblock %} diff --git a/src/templates/base.html b/src/templates/base.html index 5e96e8e1b..1f80a1a52 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -146,7 +146,7 @@ Notifications - + Change Password diff --git a/src/templates/registration/password_reset_complete.html b/src/templates/registration/password_reset_complete.html index e69a6e197..0041b9694 100644 --- a/src/templates/registration/password_reset_complete.html +++ b/src/templates/registration/password_reset_complete.html @@ -1,10 +1,14 @@ {% extends 'base.html' %} {% block content %} -
-

+
+

Password Reset Complete

-

Your password has been successfully reset.

+
+
+

Your password has been successfully reset.

+
+
{% endblock %} diff --git a/src/templates/registration/password_reset_confirm.html b/src/templates/registration/password_reset_confirm.html index 873f819bb..04b250985 100644 --- a/src/templates/registration/password_reset_confirm.html +++ b/src/templates/registration/password_reset_confirm.html @@ -1,14 +1,42 @@ {% extends 'base.html' %} {% block content %} -
-

+
+

Change Password

-
- {% csrf_token %} - {{ form.as_p }} - -
+
+

Reset your password by entering a new one.

+
+
+ {% csrf_token %} +
+
+ + +
+
+
+
+ + +
+
+ + +
+
{% endblock %} diff --git a/src/templates/registration/password_reset_done.html b/src/templates/registration/password_reset_done.html index c36f7c225..8ad764b95 100644 --- a/src/templates/registration/password_reset_done.html +++ b/src/templates/registration/password_reset_done.html @@ -3,14 +3,19 @@ {% block title %}Password reset{% endblock %} {% block content %} -
-

+
+

Password Reset Complete

-

- We have sent you an email with a link to reset your password. Please check - your email and click the link to continue. -

+
+
+

+ We have sent you an email with a link to reset your password. Please check + your email and click the link to continue. +

+
+ +
{% endblock %} diff --git a/src/templates/registration/password_reset_form.html b/src/templates/registration/password_reset_form.html index 5d225765d..4c1ca903a 100644 --- a/src/templates/registration/password_reset_form.html +++ b/src/templates/registration/password_reset_form.html @@ -4,19 +4,37 @@ {% block title %}Reset password{% endblock %} {% block content %} -
-

+
+

Reset password

- {% if user.is_authenticated %} -

Note: you are already logged in as {{ user.username }}.

- {% endif %} -

Forgot your password? Enter your email in the form below and we'll send you instructions for creating a new one.

-
- {% csrf_token %} - {{ form.as_p }} - -
+
+ {% if user.is_authenticated %} +
+

Note: you are already logged in as {{ user.username }}.

+
+ {% endif %} +
Forgot your password?
+

Enter your email in the form below and we'll send you instructions for creating a new one.

+
+
+ {% csrf_token %} +
+
+ + +
+
+ +
+
+
{% endblock %} diff --git a/src/tests/functional/test_submissions.py b/src/tests/functional/test_submissions.py index a8451797c..4315b1cd0 100644 --- a/src/tests/functional/test_submissions.py +++ b/src/tests/functional/test_submissions.py @@ -18,7 +18,7 @@ def setUp(self): super().setUp() self.user = UserFactory(password='test') - def _run_submission_and_add_to_leaderboard(self, competition_zip_path, submission_zip_path, expected_submission_output, has_solutions=True, timeout=999): + def _run_submission_and_add_to_leaderboard(self, competition_zip_path, submission_zip_path, expected_submission_output, has_solutions=True, timeout=600): """Creates a competition and runs a submission inside it, waiting for expected output to appear in submission realtime output panel. @@ -50,8 +50,9 @@ def _run_submission_and_add_to_leaderboard(self, competition_zip_path, submissio assert self.find_text_in_class('.submission-output-container .title', f"Running {submission_zip_path}", timeout=timeout) # Inside the accordion the output is being streamed + self.wait(LONG_WAIT) self.find('.submission-output-container .title').click() - self.wait(SHORT_WAIT) + self.wait(LONG_WAIT) assert self.find_text_in_class('.submission_output', expected_submission_output, timeout=timeout) # The submission table lists our submission! @@ -75,7 +76,7 @@ def _run_submission_and_add_to_leaderboard(self, competition_zip_path, submissio assert Decimal(self.find('leaderboards table tbody tr:nth-of-type(1) td:nth-of-type(3)').text) == prediction_score def test_v15_submission_end_to_end(self): - self._run_submission_and_add_to_leaderboard('competition_15.zip', 'submission_15.zip', '*** prediction_score', has_solutions=False, timeout=2000) + self._run_submission_and_add_to_leaderboard('competition_15.zip', 'submission_15.zip', '*** prediction_score', has_solutions=False) def test_v18_submission_end_to_end(self): self._run_submission_and_add_to_leaderboard('competition_18.zip', 'submission_18.zip', 'results', has_solutions=False)