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

Remove voucher columns from Grant model #4335

Merged
merged 2 commits into from
Feb 18, 2025
Merged

Conversation

estyxx
Copy link
Member

@estyxx estyxx commented Jan 28, 2025

Removed the columns pretix_voucher_id, voucher_code, and
voucher_email_sent_at from the Grant model. These columns are no
longer needed as we now use the ConferenceVoucher table for voucher
management.

What

ToDo

Copy link

vercel bot commented Jan 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
pycon ✅ Ready (Inspect) Visit Preview Feb 9, 2025 10:05am

Copy link

codecov bot commented Jan 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.45%. Comparing base (db46901) to head (d45033f).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4335      +/-   ##
==========================================
- Coverage   94.45%   94.45%   -0.01%     
==========================================
  Files         349      349              
  Lines        9950     9948       -2     
  Branches      700      700              
==========================================
- Hits         9398     9396       -2     
  Misses        462      462              
  Partials       90       90              

@@ -461,9 +459,6 @@ class GrantAdmin(ExportMixin, ConferencePermissionMixin, admin.ModelAdmin):
"total_amount",
"applicant_reply_sent_at",
"applicant_reply_deadline",
"pretix_voucher_id",
Copy link
Member

@marcoacierno marcoacierno Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be beneficial to expose in this admin something that checks if a ConferenceVoucher exists for this grant user, so we don't need to go to a different UI to check if this grant has the voucher or not. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah was thinking about.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the columns has_voucher and has_ticket

Removed the columns `pretix_voucher_id`, `voucher_code`, and
`voucher_email_sent_at` from the `Grant` model. These columns are no
longer needed as we now use the `ConferenceVoucher` table for voucher
management.
Added `has_ticket` and `has_voucher` columns to the GrantAdmin model
to determine if a user has a voucher or has redeemed a ticket. The
`has_ticket` data is fetched from Pretix via the API, while the
`has_voucher` data is retrieved from the `ConferenceVoucher` table.
@estyxx estyxx force-pushed the grants/remove-voucher-columns branch from ff5d55f to d45033f Compare February 9, 2025 10:03
@estyxx estyxx requested a review from marcoacierno February 9, 2025 18:25
@estyxx estyxx merged commit 863d7f6 into main Feb 18, 2025
6 checks passed
@estyxx estyxx deleted the grants/remove-voucher-columns branch February 18, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants