home: Remove handler for old compile-handlebars-templates error file.

As of commit 8c199fd44c (#12667) this
file is no longer generated.  Handlebars compile errors are raised as
webpack errors.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2019-07-16 22:27:20 -07:00
committed by Tim Abbott
parent 2c9f5e3980
commit 5ec2e4add4
4 changed files with 2 additions and 38 deletions

View File

@@ -1,21 +0,0 @@
{% extends "zerver/portico.html" %}
{% block customhead %}
{{ super() }}
<meta http-equiv="refresh" content="60;URL='/'">
{% endblock %}
{% block portico_content %}
<br/>
<p class="lead">Error compiling handlebars templates.</p>
<p>
Your development environment has some changes to the the
handlebars templates (<code>static/templates/</code>) that cause
them to not compile. Error details are printed in
the <code>run-dev.py</code> console; this message will go away as
soon as the handlebars templates compile again.
</p>
{% endblock %}

View File

@@ -13,7 +13,7 @@ from zerver.lib.actions import do_change_logo_source
from zerver.lib.events import add_realm_logo_fields
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import (
HostRequestMock, queries_captured, get_user_messages
queries_captured, get_user_messages
)
from zerver.lib.soft_deactivation import do_soft_deactivate_users
from zerver.lib.test_runner import slow
@@ -21,7 +21,7 @@ from zerver.models import (
get_realm, get_stream, get_user, UserProfile,
flush_per_request_caches, DefaultStream, Realm,
)
from zerver.views.home import home, sent_time_in_epoch_seconds, compute_navbar_logo_url
from zerver.views.home import sent_time_in_epoch_seconds, compute_navbar_logo_url
from corporate.models import Customer, CustomerPlan
class HomeTest(ZulipTestCase):
@@ -799,14 +799,6 @@ class HomeTest(ZulipTestCase):
user_message.message.pub_date = pub_date
self.assertEqual(sent_time_in_epoch_seconds(user_message), epoch_seconds)
def test_handlebars_compile_error(self) -> None:
request = HostRequestMock()
with self.settings(DEVELOPMENT=True, TEST_SUITE=False):
with patch('os.path.exists', return_value=True):
result = home(request)
self.assertEqual(result.status_code, 500)
self.assert_in_response('Error compiling handlebars templates.', result)
def test_subdomain_homepage(self) -> None:
email = self.example_email("hamlet")
self.login(email)

View File

@@ -114,7 +114,6 @@ class TemplateTestCase(ZulipTestCase):
'zerver/debug.html',
'zerver/base.html',
'zerver/api_content.json',
'zerver/handlebars_compilation_failed.html',
'zerver/portico-header.html',
'zerver/deprecation_notice.html',
'two_factor/_wizard_forms.html',

View File

@@ -31,7 +31,6 @@ from two_factor.utils import default_device
import calendar
import logging
import os
import time
@zulip_login_required
@@ -81,11 +80,6 @@ def compute_navbar_logo_url(page_params: Dict[str, Any]) -> str:
return navbar_logo_url
def home(request: HttpRequest) -> HttpResponse:
if (settings.DEVELOPMENT and not settings.TEST_SUITE and
os.path.exists('var/handlebars-templates/compile.error')):
response = render(request, 'zerver/handlebars_compilation_failed.html')
response.status_code = 500
return response
if not settings.ROOT_DOMAIN_LANDING_PAGE:
return home_real(request)