Ignore:
Timestamp:
Apr 10, 2020, 5:40:18 PM (7 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, master
Children:
5c9c247
Parents:
ce59b61
Message:
  • Fixed testing environment
    • Fixed some issues in the API and it's serving
File:
1 moved

Legend:

Unmodified
Added
Removed
  • src/mapservice/server_impl/database/Model.py

    rce59b61 rae2ff15  
    6666                        'lastName': "",
    6767                        'activated': user.activated,
    68                         'licenseAccepted': user.license_accepted,
     68                        'licenseAccepted': user.license_accepted
    6969                }
    7070                if user.first_name is not None:
    … …  
    374374        log = db.relationship("Log", backref=db.backref("queue"), lazy=True)
    375375
    376 def db_setup(if_not_exists = True):
    377         if not database_exists(db.engine.url) or not if_not_exists:
     376def db_setup(force = False):
     377        if not database_exists(db.engine.url) or force:
    378378                create_database(db.engine.url)
    379379                if 'sqlite' in flask.current_app.config['SQLALCHEMY_DATABASE_URI']:
    … …  
    395395        for path in paths:
    396396                if _load_spatialite_from_path(path, dbapi_conn, connection_record):
    397                         return
     397                        return True
    398398        raise FileNotFoundError('mod_spatialite not found in folders {}'.format(', '.join(paths)))
    399399                       
    … …  
    401401        for path in Path(search_path).rglob('mod_spatialite.so*'):
    402402                if os.path.exists(path):
    403                         print('Enabling spatial lite extension. This may take a while')
     403                        if flask.current_app.config['DEBUG'] and (not 'TESTING' in flask.current_app.config or not flask.current_app.config['TESTING']):
     404                                print('Enabling spatial lite extension. This may take a while')
    404405                        # From https://geoalchemy-2.readthedocs.io/en/latest/spatialite_tutorial.html
    405406                        dbapi_conn.enable_load_extension(True)
Note: See TracChangeset for help on using the changeset viewer.