diff --git a/app/db_mgr.py b/app/db_mgr.py index 51e1c1d..eaa0c34 100644 --- a/app/db_mgr.py +++ b/app/db_mgr.py @@ -86,7 +86,7 @@ def charges_by_project_stacked(project_id, category="service"): sem_n, value_n0, value_n1, ....., value_nn, """ if category == 'capacity': - category_table = 'service' + category_table = 'capacity' sql_req = """ select c.charge_rate from capacity c1 left join @@ -94,7 +94,7 @@ def charges_by_project_stacked(project_id, category="service"): order by c1.id """ elif category == 'service': - category_table = 'capacity' + category_table = 'service' sql_req = """ select c.charge_rate from service s left join @@ -103,7 +103,7 @@ def charges_by_project_stacked(project_id, category="service"): """ else: raise ValueError("Waiting for 'service' or 'capacity'") - categories_req = "select name from {} order by id".format(category) + categories_req = "select name from {} order by id".format(category_table) categories = [c for (c,) in db.session.execute(categories_req)] headers = ['period']+categories all_charges = [headers] -- libgit2 0.21.2