Changeset - 0d949cbb4f89
[Not reviewed]
0 1 0
Lance Edgar (lance) - 2 months ago 2024-08-27 13:07:06
lance@edbob.org
fix: hopefully fix startup continuum bug per 'active_history' models

only have one model in the wild (SpecialOrder) which uses
active_history and it probably shouldn't really.. it was written a
long time ago and would need some refactoring.

but for now we just need things to work, and this seems to do it
although i have no idea why
1 file changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rattail/db/config.py
Show inline comments
 
@@ -96,7 +96,17 @@ def configure_versioning(config, force=False, manager=None, plugins=None, **kwar
 
        # TODO: is this the best way/place to confirm versioning?
 
        app = config.get_app()
 
        try:
 
            # TODO: not sure why but if we don't load app.model here,
 
            # for some reason the alembic upgrade command may fail, if
 
            # any app models include the 'active_history' feature?!
 
            model = app.model
 

	
 
            # but when confirming if versioning is working, we
 
            # definitely need to check a "native" model and not
 
            # anything from app.model, which may use a totally
 
            # different base class with no versioning (i.e. wutta)
 
            from rattail.db.model import User
 

	
 
            configure_mappers()
 
            transaction_class = continuum.transaction_class(User)
 
            config.versioning_has_been_enabled = True
0 comments (0 inline, 0 general)