Changeset ae2ff15 for src/mapservice/server_impl/database/Model.py
- Timestamp:
- Apr 10, 2020, 5:40:18 PM (7 years ago)
- Branches:
- debian/bullseye, master
- Children:
- 5c9c247
- Parents:
- ce59b61
- File:
-
- 1 moved
-
src/mapservice/server_impl/database/Model.py (moved) (moved from src/mapservice/src/server_impl/database/Model.py ) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/mapservice/server_impl/database/Model.py
rce59b61 rae2ff15 66 66 'lastName': "", 67 67 'activated': user.activated, 68 'licenseAccepted': user.license_accepted ,68 'licenseAccepted': user.license_accepted 69 69 } 70 70 if user.first_name is not None: … … 374 374 log = db.relationship("Log", backref=db.backref("queue"), lazy=True) 375 375 376 def db_setup( if_not_exists = True):377 if not database_exists(db.engine.url) or not if_not_exists:376 def db_setup(force = False): 377 if not database_exists(db.engine.url) or force: 378 378 create_database(db.engine.url) 379 379 if 'sqlite' in flask.current_app.config['SQLALCHEMY_DATABASE_URI']: … … 395 395 for path in paths: 396 396 if _load_spatialite_from_path(path, dbapi_conn, connection_record): 397 return 397 return True 398 398 raise FileNotFoundError('mod_spatialite not found in folders {}'.format(', '.join(paths))) 399 399 … … 401 401 for path in Path(search_path).rglob('mod_spatialite.so*'): 402 402 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') 404 405 # From https://geoalchemy-2.readthedocs.io/en/latest/spatialite_tutorial.html 405 406 dbapi_conn.enable_load_extension(True)
Note:
See TracChangeset
for help on using the changeset viewer.
