From e7d2d98e19c2b9e620d1579850436eef066d1bd0 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 15 Jul 2020 21:46:22 -0500 Subject: [PATCH] Show versions for integration packages in about page --- theo/web/views/common.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/theo/web/views/common.py b/theo/web/views/common.py index 7f0c812..898987a 100644 --- a/theo/web/views/common.py +++ b/theo/web/views/common.py @@ -27,6 +27,7 @@ Common views from tailbone.views import common as base import theo +from theo.config import integrate_catapult, integrate_corepos class CommonView(base.CommonView): @@ -34,6 +35,27 @@ class CommonView(base.CommonView): project_title = "tailbone-theo" project_version = theo.__version__ + '+dev' + def get_packages(self): + packages = super(CommonView, self).get_packages() + + if integrate_catapult(self.rattail_config): + import onager + import rattail_onager + import tailbone_onager + packages['onager'] = onager.__version__ + packages['rattail-onager'] = rattail_onager.__version__ + packages['tailbone-onager'] = tailbone_onager.__version__ + + elif integrate_corepos(self.rattail_config): + import corepos + import rattail_corepos + import tailbone_corepos + packages['pyCOREPOS'] = corepos.__version__ + packages['rattail-corepos'] = rattail_corepos.__version__ + packages['tailbone-corepos'] = tailbone_corepos.__version__ + + return packages + def includeme(config): CommonView.defaults(config)