diff options
| author | 2018-04-08 01:13:26 +0100 | |
|---|---|---|
| committer | 2018-04-08 01:13:26 +0100 | |
| commit | 886fb0b06117e56cc70767424b718c90e2789ef4 (patch) | |
| tree | 45f21dc888afdb43b4e4e983fc9e199665fbdb57 | |
| parent | Fix debug mode indicator (diff) | |
Fix build
Diffstat (limited to '')
| -rw-r--r-- | .travis.yml | 1 | ||||
| -rw-r--r-- | gunicorn_config.py | 15 | ||||
| -rw-r--r-- | templates/main/navigation.html | 2 | 
3 files changed, 14 insertions, 4 deletions
| diff --git a/.travis.yml b/.travis.yml index 284ec24f..95fdcfc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ install:    - pip install -r requirements-ci.txt  script:    - flake8 +  - python gunicorn_config.py    - py.test app_test.py --cov pysite --cov-report term-missing -v    - coveralls  after_success: diff --git a/gunicorn_config.py b/gunicorn_config.py index e4b66135..eb2f6e1b 100644 --- a/gunicorn_config.py +++ b/gunicorn_config.py @@ -1,12 +1,21 @@  # coding=utf-8 -def when_ready(server): +def when_ready(server=None):      """ server hook that only runs when the gunicorn master process loads """ -    server.log.info("Creating tables...") +    if server: +        output = server.log.info +    else: +        output = print + +    output("Creating tables...")      from pysite.database import RethinkDB      db = RethinkDB(loop_type=None)      created = db.create_tables() -    server.log.info(f"Created {created} tables.") +    output(f"Created {created} tables.") + + +if __name__ == "__main__": +    when_ready() diff --git a/templates/main/navigation.html b/templates/main/navigation.html index 19322c65..47c20d56 100644 --- a/templates/main/navigation.html +++ b/templates/main/navigation.html @@ -39,7 +39,7 @@                                      <li class="uk-active"><a href="{{ url_for('discord.login') }}"><i class="uk-icon fas fa-lock"></i>  Login with Discord</a></li>                                  {% endif %}                              {% else %} -                                <li class="uk-active"><a><i class="uk-icon fas fa-exclamation-triangle"></i>  Debug mode</a></li> +                                <li class="uk-active"><a style="color: #7289DA !important"><i class="uk-icon fas fa-exclamation-triangle"></i>  Debug mode</a></li>                              {% endif %}                              {% if current_page.startswith("info") %} | 
