Skip to content

Commit

Permalink
Update registration sheet (#831)
Browse files Browse the repository at this point in the history
* Added Waitlist status to rows

* Changed rows to end at AB instead of AA

* Updated tests to check for waitlist

* Updated registration sheet tests to check for waitlist header

* Moved position of waitlist header, updated tests
  • Loading branch information
NamanSatish authored Jan 19, 2024
1 parent 21fc489 commit 271aeac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 7 additions & 4 deletions huxley/core/admin/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ 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"
Expand All @@ -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 [
Expand All @@ -60,8 +61,10 @@ def get_rows(self):
registration.invoices_sent
]
] + payment_type_string +
country_preferences + committee_preferences +
[str(registration.registration_comments)])
is_waitlisted_string +
country_preferences +
committee_preferences +
[str(registration.registration_comments)])
return rows

def info(self, request):
Expand All @@ -79,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)
Expand Down
4 changes: 3 additions & 1 deletion huxley/core/tests/admin/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ 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"
Expand All @@ -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,
Expand All @@ -61,6 +62,7 @@ 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)
Expand Down

0 comments on commit 271aeac

Please sign in to comment.