diff --git a/SchemaCollaboration/core/templatetags/includefile.py b/SchemaCollaboration/core/templatetags/includefile.py index 5f96eaf..ef0430b 100644 --- a/SchemaCollaboration/core/templatetags/includefile.py +++ b/SchemaCollaboration/core/templatetags/includefile.py @@ -10,8 +10,9 @@ @register.simple_tag def include_homepage(): + content = '' if settings.HOMEPAGE_FILE is None: - return mark_safe(f''' + content = f'''

Welcome to schema-collaboration

This is the default homepage. Set the environment variable DEFAULT_HOMEPAGE point at an HTML file to change it. @@ -23,10 +24,12 @@ def include_homepage(): href="{reverse('login')}">management area (login required available on the next page). - ''') + ''' else: file_content = read_file(settings.HOMEPAGE_FILE) if file_content is None: - return f'''Cannot load {settings.HOMEPAGE_FILE}. Please make sure that it exist and is readable by schema-collaboration.''' + content = f'''Cannot load {settings.HOMEPAGE_FILE}. Please make sure that it exist and is readable by schema-collaboration.''' else: - return file_content + content = file_content + + return mark_safe(content)