Summary
Migration 0002_geo.py (initial = True) currently imports create_default_collection_types from the runtime module specifyweb/specify/utils.py and calls it via handle_default_collection_types(apps). Because runtime helpers can change over time, future modifications to specifyweb/specify/utils.py (e.g., to create_default_collection_types, BusinessRuleException usage, or logging) could silently alter or break this already-shipped migration on fresh installs.
Desired outcome
As part of the broader effort to modularize and freeze migration code:
- Inline the relevant logic directly inside
0002_geo.py, or
- Move it into a dedicated frozen migration-only helper module (alongside the migrations package) that is never modified after being shipped.
- Ensure the migration does not reference any live runtime symbols (e.g.,
BusinessRuleException, logger) from specifyweb/specify/utils.
Context
/cc @CarolineDenis
Summary
Migration
0002_geo.py(initial = True) currently importscreate_default_collection_typesfrom the runtime modulespecifyweb/specify/utils.pyand calls it viahandle_default_collection_types(apps). Because runtime helpers can change over time, future modifications tospecifyweb/specify/utils.py(e.g., tocreate_default_collection_types,BusinessRuleExceptionusage, or logging) could silently alter or break this already-shipped migration on fresh installs.Desired outcome
As part of the broader effort to modularize and freeze migration code:
0002_geo.py, orBusinessRuleException,logger) fromspecifyweb/specify/utils.Context
/cc @CarolineDenis