gem / oq-engine

OpenQuake's Engine for Seismic Hazard and Risk Analysis
https://github.com/gem/oq-engine/#openquake-engine
GNU Affero General Public License v3.0
374 stars 272 forks source link

Avoid checking webui variables at import time #9723

Closed ptormene closed 1 month ago

ptormene commented 1 month ago

Checks were moved to the ready() method of the ServerConfig class, the runs only once when the webui is started. I also changed the way django.contrib.auth.models.User is loaded: instead of importing it, there is a django get_user_model function that loads it at runtime.

This change allows for instance to run commands such as oq mosaic aristotle mosaic_dir without the automatic check on the presence of mosaic_dir in openquake.cfg.

Fixes https://github.com/gem/oq-engine/issues/9718

micheles commented 1 month ago

Perfect!