Adjustment in travis ci configs. Fix importing during first time running db upgrade

This commit is contained in:
Khanh Ngo
2018-08-20 17:21:32 +07:00
parent 0b7580c82f
commit 8af7a6ac9e
4 changed files with 24 additions and 5 deletions

View File

@ -4,6 +4,7 @@ from flask_login import LoginManager
from flask_sqlalchemy import SQLAlchemy as SA
from flask_migrate import Migrate
from flask_oauthlib.client import OAuth
from sqlalchemy.exc import OperationalError
# subclass SQLAlchemy to enable pool_pre_ping
class SQLAlchemy(SA):
@ -35,4 +36,9 @@ if app.config.get('SAML_ENABLED') and app.config.get('SAML_ENCRYPT'):
if not certutil.check_certificate():
certutil.create_self_signed_cert()
from app import models, views
from app import models
try:
from app import views
except OperationalError:
logging.error("You have not initialized the DB yet or DB migration is running...")

View File

@ -267,7 +267,7 @@
applyChanges({'domain': domain}, $SCRIPT_ROOT + '/domain/' + domain + '/update');
});
{% if SETTING.get('record_helper_setting') %}
{% if SETTING.get('record_helper') %}
//handle wacky record types
$(document.body).on("focus", "#current_edit_record_data", function (e) {
var record_type = $(this).parents("tr").find('#record_type').val();