Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update registration sheet #831

Merged
merged 5 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading