8000 refactor: use new meeting.Registration model by rpcross · Pull Request #8902 · ietf-tools/datatracker · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: use new meeting.Registration model #8902

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

Merged
merged 8 commits into from
Jun 10, 2025

Conversation

rpcross
Copy link
Collaborator
@rpcross rpcross commented May 14, 2025

Migrate everything that uses stats.MeetingRegistration to meeting.Registration

Copy link
codecov bot commented May 14, 2025

Codecov Report

Attention: Patch coverage is 88.48485% with 19 lines in your changes missing coverage. Please review.

Please upload report for BASE (feat/regapi@ae67dfc). Learn more about missing BASE report.

Files with missing lines Patch % Lines
ietf/meeting/utils.py 88.09% 15 Missing ⚠️
ietf/api/views.py 75.00% 3 Missing ⚠️
ietf/meeting/models.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##             feat/regapi    #8902   +/-   ##
==============================================
  Coverage               ?   88.90%           
==============================================
  Files                  ?      314           
  Lines                  ?    41466           
  Branches               ?        0           
==============================================
  Hits                   ?    36865           
  Misses                 ?     4601           
  Partials               ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

rjsparks
rjsparks previously approved these changes May 16, 2025
Copy link
Member
@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

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

Looks fine to me. Curious about the PROTECT change - why it was added and removed. It seems potentially useful as a guard against deleting a Person who still has data tied to them.

@rpcross rpcross dismissed stale reviews from jennifer-richards and rjsparks via 877b9d8 May 20, 2025 16:11
@rpcross
Copy link
Collaborator Author
rpcross commented May 20, 2025

Looks fine to me. Curious about the PROTECT change - why it was added and removed. It seems potentially useful as a guard against deleting a Person who still has data tied to them.

The final state is on_delete=PROTECT. I had briefly changed to SET_NULL but reverted that change.

@rpcross rpcross requested a review from jennifer-richards May 20, 2025 18:55
@jennifer-richards
Copy link
Member

The final state is on_delete=PROTECT. I had briefly changed to SET_NULL but reverted that change.

Ah, I must have confused myself by looking at individual commits.

Copy link
Member
@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

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

Is there anything in the models enforcing attendance_type to be not-None? Perhaps it should raise an exception instead of returning None in the "no tickets" case. Unless places that use the property check for None, it's likely to cause a strange exception, so it might be better to raise one that points at "Registration has no tickets" or some other helpful message.

@rpcross
Copy link
Collaborator Author
rpcross commented May 21, 2025

Is there anything in the models enforcing attendance_type to be not-None? Perhaps it should raise an exception instead of returning None in the "no tickets" case. Unless places that use the property check for None, it's likely to cause a strange exception, so it might be better to raise one that points at "Registration has no tickets" or some other helpful message.

There is not a restriction in the models but there is in the business logic. Any new registration has a registration type (attendance type). If after a registration cancellation, there are no tickets, the Registration object is deleted. There is an edge case, you could have a Registration with only an Onsite Hackathon ticket for example and this property would return None. It's only use right now is in the proceedings view which already filters on 'onsite', 'remote' types. So it's very speculative, if a new use is added that encounters this edge should it print "None" or fail with an exception? Whichever is preferred.

@jennifer-richards
Copy link
Member

So it's very speculative, if a new use is added that encounters this edge should it print "None" or fail with an exception? Whichever is preferred.

Sounds like None is fine. Thanks!

@rjsparks rjsparks changed the base branch from main to feat/regapi June 10, 2025 14:06
@rjsparks rjsparks merged commit 047de24 into ietf-tools:feat/regapi Jun 10, 2025
10 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0