Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/apps/pages/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)
Binary file added src/static/img/404.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/templates/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends "base.html" %}


{% block content %}
<div class="sixteen wide mobile eight wide computer centered column">
<img src="/static/img/404.png">
<p>Could not find the page you requested.</p>
<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>
<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://github.com/codalab/codabench/wiki">wiki</a>.</p>
<a class="ui fluid blue submit button" href="/">Return to Home</a>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion src/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
Notifications
</a>
<a class="item" href="{% url 'accounts:password_reset' %}">
<i class="icon sign out"></i>
<i class="lock icon"></i>
Change Password
</a>
<a class="item" href="{% url 'accounts:logout' %}">
Expand Down
10 changes: 7 additions & 3 deletions src/templates/registration/password_reset_complete.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{% extends 'base.html' %}

{% block content %}
<div class="six wide centered column">
<h2 class="ui blue header">
<div class="sixteen wide mobile six wide computer centered column">
<h2 class="ui blue centered header">
Password Reset Complete
</h2>
<p>Your password has been successfully reset.</p>
<div class="ui stacked segment">
<div class="ui green message">
<p>Your password has been successfully reset.</p>
</div>
</div>
</div>
{% endblock %}
42 changes: 35 additions & 7 deletions src/templates/registration/password_reset_confirm.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
{% extends 'base.html' %}

{% block content %}
<div class="six wide centered column">
<h2 class="ui blue header">
<div class="sixteen wide mobile six wide computer centered column">
<h2 class="ui blue centered header">
Change Password
</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Reset Password</button>
</form>
<div class="ui stacked segment">
<p>Reset your password by entering a new one.</p>
<div class="ui divider"></div>
<form class="ui form" method="POST">
{% csrf_token %}
<div class="field">
<div class="ui left icon input">
<i class="lock icon"></i>
<input type="password"
name="new_password1"
placeholder="new password"
id="id_new_password1"
value=""
maxlength=""
required>
</div>
</div>
<div class="field">
<div class="ui left icon input">
<i class="lock icon"></i>
<input type="password"
name="new_password2"
placeholder="repeat new password"
id="id_new_password2"
value=""
maxlength=""
required>
</div>
</div>

<button class="ui fluid blue submit button" type="submit">Reset password</button>
</form>
</div>
</div>
{% endblock %}
17 changes: 11 additions & 6 deletions src/templates/registration/password_reset_done.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
{% block title %}Password reset{% endblock %}

{% block content %}
<div class="six wide centered column">
<h2 class="ui blue header">
<div class="sixteen wide mobile six wide computer centered column">
<h2 class="ui blue centered header">
Password Reset Complete
</h2>
<p>
We have sent you an email with a link to reset your password. Please check
your email and click the link to continue.
</p>
<div class="ui stacked segment">
<div class="ui blue message">
<p>
We have sent you an email with a link to reset your password. Please check
your email and click the link to continue.
</p>
</div>

</div>
</div>
{% endblock %}

Expand Down
40 changes: 29 additions & 11 deletions src/templates/registration/password_reset_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,37 @@
{% block title %}Reset password{% endblock %}

{% block content %}
<div class="six wide centered column">
<h2 class="ui blue header">
<div class="sixteen wide mobile six wide computer centered column">
<h2 class="ui blue centered header">
Reset password
</h2>
{% if user.is_authenticated %}
<p><strong>Note:</strong> you are already logged in as {{ user.username }}.</p>
{% endif %}
<p>Forgot your password? Enter your email in the form below and we'll send you instructions for creating a new one.</p>
<form method="post" action="">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Reset password" />
</form>
<div class="ui stacked segment">
{% if user.is_authenticated %}
<div class="ui blue message">
<p><strong>Note:</strong> you are already logged in as {{ user.username }}.</p>
</div>
{% endif %}
<h5>Forgot your password?</h5>
<p>Enter your email in the form below and we'll send you instructions for creating a new one.</p>
<div class="ui divider"></div>
<form class="ui form" method="POST">
{% csrf_token %}
<div class="field">
<div class="ui left icon input">
<i class="user icon"></i>
<input type="email"
name="email"
placeholder="email"
id="id_email"
value=""
maxlength=""
required>
</div>
</div>
<button class="ui fluid blue submit button" type="submit">Reset password</button>
<div class="ui error message"></div>
</form>
</div>
</div>
{% endblock %}

Expand Down
7 changes: 4 additions & 3 deletions src/tests/functional/test_submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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!
Expand All @@ -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)
Expand Down