From 42f2074aa939a702e40d9d3258ca5f9da4472efb Mon Sep 17 00:00:00 2001 From: Naman Satish Date: Mon, 18 Dec 2023 16:01:43 -0800 Subject: [PATCH 1/5] Added Waitlist status to rows --- huxley/core/admin/registration.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/huxley/core/admin/registration.py b/huxley/core/admin/registration.py index d6fbb033..d4c22e02 100644 --- a/huxley/core/admin/registration.py +++ b/huxley/core/admin/registration.py @@ -26,7 +26,7 @@ def get_rows(self): "Paid Registration Fee?", "Invoice Sent", "Payment Type", "Country 1", "Country 2", "Country 3", "Country 4", "Country 5", "Country 6", "Country 7", "Country 8", "Country 9", "Country 10", "Committee Preferences", - "Registration Comments" + "Registration Comments", "Waitlisted" ]) for registration in Registration.objects.all().order_by( @@ -42,6 +42,7 @@ def get_rows(self): for cp in registration.committee_preferences.all()) ] payment_type_string = ['Credit Card' if registration.payment_type == 1 else 'Check'] + is_waitlisted_string = ['Yes' if registration.is_waitlisted == 1 else 'No'] rows.append([ str(field) for field in [ @@ -60,8 +61,10 @@ def get_rows(self): registration.invoices_sent ] ] + payment_type_string + - country_preferences + committee_preferences + - [str(registration.registration_comments)]) + country_preferences + + committee_preferences + + [str(registration.registration_comments)] + + is_waitlisted_string ) return rows def info(self, request): From 1c6af2ac1201d7c6b95b11a95151d878d030bae8 Mon Sep 17 00:00:00 2001 From: Naman Satish Date: Mon, 18 Dec 2023 16:14:20 -0800 Subject: [PATCH 2/5] Changed rows to end at AB instead of AA --- huxley/core/admin/registration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/huxley/core/admin/registration.py b/huxley/core/admin/registration.py index d4c22e02..0b329824 100644 --- a/huxley/core/admin/registration.py +++ b/huxley/core/admin/registration.py @@ -82,7 +82,7 @@ def info(self, request): def sheets(self, request): if settings.SHEET_ID: - SHEET_RANGE = 'Registration!A1:AA' + SHEET_RANGE = 'Registration!A1:AB' # Store credentials creds = service_account.Credentials.from_service_account_file( settings.SERVICE_ACCOUNT_FILE, scopes=settings.SCOPES) From d5fe61a5c13fafa5f5a1202c403827a8b243f73c Mon Sep 17 00:00:00 2001 From: Naman Satish Date: Mon, 18 Dec 2023 16:20:48 -0800 Subject: [PATCH 3/5] Updated tests to check for waitlist --- huxley/core/tests/admin/test_registration.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/huxley/core/tests/admin/test_registration.py b/huxley/core/tests/admin/test_registration.py index cdb74e44..dfd1b627 100644 --- a/huxley/core/tests/admin/test_registration.py +++ b/huxley/core/tests/admin/test_registration.py @@ -41,6 +41,7 @@ def test_preference_export(self): cp.name for cp in registration.committee_preferences.all())] payment_type_string = ['Credit Card' if registration.payment_type == 1 else 'Check'] + is_waitlisted_string = ['Yes' if registration.is_waitlisted == 1 else 'No'] fields = [ registration.registered_at, @@ -64,6 +65,7 @@ def test_preference_export(self): fields.extend(country_preferences) fields.extend(committee_preferences) fields.extend(registration.registration_comments) + fields.extend(is_waitlisted_string) fields_csv += ','.join(map(str, fields)) self.assertEquals(fields_csv, response.content[:-3].decode('utf-8')) From 816de3586b240c826a12e19909727072af2a5a6f Mon Sep 17 00:00:00 2001 From: Naman Satish Date: Mon, 18 Dec 2023 16:22:01 -0800 Subject: [PATCH 4/5] Updated registration sheet tests to check for waitlist header --- huxley/core/tests/admin/test_registration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/huxley/core/tests/admin/test_registration.py b/huxley/core/tests/admin/test_registration.py index dfd1b627..460d0f5e 100644 --- a/huxley/core/tests/admin/test_registration.py +++ b/huxley/core/tests/admin/test_registration.py @@ -28,7 +28,7 @@ def test_preference_export(self): "Invoice Sent", "Payment Type", "Country 1", "Country 2", "Country 3", "Country 4", "Country 5", "Country 6", "Country 7", "Country 8", "Country 9", "Country 10", - "Committee Preferences", "Registration Comments" + "Committee Preferences", "Registration Comments", "Waitlisted" ] fields_csv = ",".join(map(str, header)) + "\r\n" From 67906619ba496c57e3b2378b842c68a7f43c6d7c Mon Sep 17 00:00:00 2001 From: Naman Satish Date: Mon, 18 Dec 2023 16:44:08 -0800 Subject: [PATCH 5/5] Moved position of waitlist header, updated tests --- huxley/core/admin/registration.py | 8 ++++---- huxley/core/tests/admin/test_registration.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/huxley/core/admin/registration.py b/huxley/core/admin/registration.py index 0b329824..fab3b656 100644 --- a/huxley/core/admin/registration.py +++ b/huxley/core/admin/registration.py @@ -23,10 +23,10 @@ def get_rows(self): "Beginners", "Intermediates", "Advanced", "Spanish Speakers", "Chinese Speakers", "Assignments Finalized", "Waivers Complete", "Delegate Fees Paid", "Delegate Fees Owed", - "Paid Registration Fee?", "Invoice Sent", "Payment Type", "Country 1", "Country 2", "Country 3", + "Paid Registration Fee?", "Invoice Sent", "Payment Type", "Waitlisted", "Country 1", "Country 2", "Country 3", "Country 4", "Country 5", "Country 6", "Country 7", "Country 8", "Country 9", "Country 10", "Committee Preferences", - "Registration Comments", "Waitlisted" + "Registration Comments" ]) for registration in Registration.objects.all().order_by( @@ -61,10 +61,10 @@ def get_rows(self): registration.invoices_sent ] ] + payment_type_string + + is_waitlisted_string + country_preferences + committee_preferences + - [str(registration.registration_comments)] + - is_waitlisted_string ) + [str(registration.registration_comments)]) return rows def info(self, request): diff --git a/huxley/core/tests/admin/test_registration.py b/huxley/core/tests/admin/test_registration.py index 460d0f5e..a3377ac8 100644 --- a/huxley/core/tests/admin/test_registration.py +++ b/huxley/core/tests/admin/test_registration.py @@ -25,10 +25,10 @@ def test_preference_export(self): "Beginners", "Intermediates", "Advanced", "Spanish Speakers", "Chinese Speakers", "Assignments Finalized", "Waivers Complete", "Delegate Fees Paid", "Delegate Fees Owed", "Paid Registration Fee?", - "Invoice Sent", "Payment Type", + "Invoice Sent", "Payment Type", "Waitlisted", "Country 1", "Country 2", "Country 3", "Country 4", "Country 5", "Country 6", "Country 7", "Country 8", "Country 9", "Country 10", - "Committee Preferences", "Registration Comments", "Waitlisted" + "Committee Preferences", "Registration Comments" ] fields_csv = ",".join(map(str, header)) + "\r\n" @@ -62,10 +62,10 @@ def test_preference_export(self): registration.invoices_sent ] fields.extend(payment_type_string) + fields.extend(is_waitlisted_string) fields.extend(country_preferences) fields.extend(committee_preferences) fields.extend(registration.registration_comments) - fields.extend(is_waitlisted_string) fields_csv += ','.join(map(str, fields)) self.assertEquals(fields_csv, response.content[:-3].decode('utf-8'))