-
Notifications
You must be signed in to change notification settings - Fork 187
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
Reject user registration edits if comp has started #10605
base: main
Are you sure you want to change the base?
Conversation
You mean in the legacy system? |
In v2/registration checker as well |
Co-authored-by: Gregor Billing <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, not quite sure whether this is the right place for this check. The method name allowed
is a bit ambiguous, in my mind it refers to the "legal" permission to make edits per WCRP and competition settings. It should distinguish between comps who allow edits in general, vs. competitions who opted out of edits in the first place.
The start date could also be checked elsewehere, i.e. at the call-site where the changes are being made. And then just return early instead of continuing to process.
Anyhow, feel free to argue/debate. But no matter what conclusion we reach, this PR should definitely be backed by tests. The fact that tests passed before this change and tests continue to pass after this change indicates that our existing tests are not very helpful or conclusive.
Agreed, this should absolutely be supported by tests - rare "Duncan doesn't submit tests" moment.
I think the Competition model is the appropriate place for this check - the method is being called from registration_checker:81, which already has a lot of logic going on - so I feel strongly that the we should be delegating the responsibility of handling the specifics of whether a comp may be edited to the comp itself.
EDIT: I have now changed the method name which may address all your concerns and make the yapping below unnecessary The intention of the method - in my mind at least - is determine whether registrations may be edited for any reason. If we want to know specifically whether edits are allowed per competition settings, we can just call I'm not aware of any WCRP limitations on registrations being editable at the competition-level [beyond dates] - but if you have specific examples in mind, let me know. [1] If your concern is that allow_registration_edits and registration_edits_allowed? are very similar method names, and it isn't clear that the latter has a broader scope than the former, then I hear where you're coming from and am happy to think about alternatives. |
Fixes #10513
We missed this case because we always checked edits against the registration edit deadline. Another option here could be to default the edit deadline to the comp's start date