ckan / ckanext-pages

A simple builtin CMS for CKAN sites
GNU General Public License v3.0
51 stars 99 forks source link

Move database initialization to cli #112

Closed Zharktas closed 3 years ago

Zharktas commented 3 years ago

Fixes #106

Database initialization code is executed on all actions and auth functions which probably leads to errors on multi-thread environments. This PR moves the initialization code to cli and is more inline with the other extensions and good conventions. Database initialization is also somewhat cleaned as raw sql lines were removed as sqlalchemy mapper already existed.

Also flake8 violations are fixed.