Add function to retrieve survey configurations from DB.

As the survey definitions will no longer be stored in files
under etc/surveys/ but directly on the database, this
function replaces configuration.surveys()
This commit is contained in:
D. Berge
2023-08-30 14:19:56 +02:00
parent 25ab623328
commit c99a625b60
8 changed files with 45 additions and 35 deletions

View File

@@ -20,12 +20,11 @@ from datastore import Datastore
if __name__ == '__main__':
print("Reading configuration")
surveys = configuration.surveys()
file_min_age = configuration.read().get('imports', {}).get('file_min_age', 10)
print("Connecting to database")
db = Datastore()
db.connect()
surveys = db.surveys()
print("Reading surveys")
for survey in surveys: