From c5a13e0b5c20e788ba35b9db839f15c53a7c2430 Mon Sep 17 00:00:00 2001 From: sophia-massie <96220951+sophia-massie@users.noreply.github.com> Date: Thu, 9 Nov 2023 09:06:14 -0600 Subject: [PATCH] task/update-sub-admin-query-table (#246) --- apcd-cms/src/apps/utils/apcd_database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apcd-cms/src/apps/utils/apcd_database.py b/apcd-cms/src/apps/utils/apcd_database.py index 3243dcae..051950c4 100644 --- a/apcd-cms/src/apps/utils/apcd_database.py +++ b/apcd-cms/src/apps/utils/apcd_database.py @@ -155,7 +155,7 @@ def get_registrations(reg_id=None, submitter_code=None): registrations.registration_year FROM registrations {f"WHERE registration_id = {str(reg_id)}" if reg_id is not None else ''} - {f"LEFT JOIN submitters on registrations.registration_id = submitters.registration_id WHERE submitter_code = '{str(submitter_code)}' ORDER BY registrations.registration_id" if submitter_code is not None else ''}""" + {f"LEFT JOIN registration_submitters on registrations.registration_id = registration_submitters.registration_id LEFT JOIN submitters ON registration_submitters.submitter_id = submitters.submitter_id WHERE submitter_code = '{str(submitter_code)}' ORDER BY registrations.registration_id" if submitter_code is not None else ''}""" cur = conn.cursor() cur.execute(query) return cur.fetchall()