Skip to content
Snippets Groups Projects
Unverified Commit c121986c authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #622 from OpenTechFund/bugfix/534-closed-labs

Bugfix/534 closed labs
parents 589e695a 68e4275d
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,11 @@ class ApplicationBase(EmailForm, WorkflowStreamForm): # type: ignore
parent_page_types = ['apply_home.ApplyHomePage']
def get_template(self, request, *args, **kwargs):
# We want to force children to use our base template
# template attribute is ignored by children
return 'funds/application_base.html'
def detail(self):
# The location to find out more information
return self.application_public.first()
......
{% extends "base.html" %}
{% load wagtailcore_tags static i18n %}
{% load wagtailcore_tags static i18n util_tags %}
{# Dont include fixed apply button on this page #}
{% block apply_button %}{% endblock %}
{% block header_modifier %}header--light-bg{% endblock %}
......@@ -23,8 +23,8 @@
<div class="wrapper wrapper--medium wrapper--light-grey-bg wrapper--form">
{% if not page.open_round and not page.start_date and not request.is_preview %}
{# the fund has no open rounds and we arent on a round page #}
<h3>{% trans "Sorry this fund is not accepting applications at the moment" %}</h3>
{# the page has no open rounds and we arent on a round page #}
<h3>{% blocktrans %}Sorry this {{ page|verbose_name }} is not accepting applications at the moment{% endblocktrans %}</h3>
{% else%}
<form class="form" action="" method="POST" enctype="multipart/form-data">
{{ form.media }}
......
{% extends "funds/fund_type.html" %}
{% extends "funds/application_base.html" %}
{% extends "funds/fund_type_landing.html" %}
{% extends "funds/application_base_landing.html" %}
{% extends "funds/fund_type.html" %}
{% extends "funds/application_base.html" %}
{% block page_title %}{{ page.get_parent.title }}{% endblock %}
......
{% extends "funds/fund_type_landing.html" %}
{% extends "funds/application_base_landing.html" %}
{% block page_title %}{{ page.get_parent.title }}{% endblock %}
......@@ -40,8 +40,10 @@ __all__ = [
'LabFactory',
'LabBaseFormFactory',
'LabSubmissionFactory',
'RequestForPartnersFactory',
'SealedRoundFactory',
'SealedSubmissionFactory',
'TodayRoundFactory',
'workflow_for_stages',
]
......
......@@ -19,7 +19,9 @@ from .factories import (
CustomFormFieldsFactory,
FundTypeFactory,
LabFactory,
RequestForPartnersFactory,
RoundFactory,
TodayRoundFactory,
)
......@@ -465,3 +467,20 @@ class TestSubmissionRenderMethods(TestCase):
)
answers = submission.render_answers()
self.assertNotIn(rich_text_label, answers)
class TestRequestForPartners(TestCase):
def test_message_when_no_round(self):
rfp = RequestForPartnersFactory()
request = make_request(site=rfp.get_site())
response = rfp.serve(request)
self.assertContains(response, 'not accepting')
self.assertNotContains(response, 'Submit')
def test_form_when_round(self):
rfp = RequestForPartnersFactory()
TodayRoundFactory(parent=rfp)
request = make_request(site=rfp.get_site())
response = rfp.serve(request)
self.assertNotContains(response, 'not accepting')
self.assertContains(response, 'Submit')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment