Changeset - fb70abdc9243
[Not reviewed]
0 1 0
Lance Edgar (lance) - 2 months ago 2024-08-20 15:20:15
lance@edbob.org
fix: partially restore previous logic for `app.get_version()`

latest refactor for that was too aggressive, and tests complained
1 file changed with 8 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rattail/app.py
Show inline comments
 
@@ -142,10 +142,11 @@ class AppHandler(WuttaAppHandler):
 
    def get_version(self, **kwargs):
 
        """ """
 

	
 
        # first try standard logic
 
        version = super().get_version(**kwargs)
 
        if version:
 
            return version
 
        # try standard logic first if kwargs specified
 
        if kwargs:
 
            version = super().get_version(**kwargs)
 
            if version:
 
                return version
 

	
 
        # if config has defined the (legacy) rattail.app_package
 
        # setting, use that (this is hacky but it works..)
 
@@ -158,6 +159,9 @@ class AppHandler(WuttaAppHandler):
 
            mod = importlib.import_module(pkg)
 
            return mod.__version__
 

	
 
        # otherwise use upstream logic
 
        return super().get_version(**kwargs)
 

	
 
    def get_class_prefix(self, default=None):
 
        """
 
        Returns the "class prefix" for the app, used when naming model
0 comments (0 inline, 0 general)