-
Notifications
You must be signed in to change notification settings - Fork 186
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
Allow organizers to prevent any paid user from cancelling #10807
base: main
Are you sure you want to change the base?
Conversation
…/worldcubeassociation.org into reg-feature/cancel-restrictions
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.
I'm not too wild about the naming scheme in general. Why are you coming at this from the "restrictions" perspective? In my opinion, the natural question to ask is "Are competitors allowed to cancel their own registrations?". And if that's the question, then the answer should be:
- Yes, anytime.
- Yes, but only if they aren't accepted yet.
- Yes, but only if they haven't paid yet.
In your changes to the YAML file, you use descriptions which indicate when people are NOT allowed to cancel, but perhaps it's more accessible if you specify when you DO allow people to cancel.
db/migrate/20250210071551_expand_cancellation_restrictions_for_competitions.rb
Outdated
Show resolved
Hide resolved
EDIT: Disregard previous comment, a better version of the wording came to me in a dream |
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.
I was a few seconds short of merging this, but then it occured to me: This changes user interaction with the competition form significantly!
Previously, the default for the old allow_registration_self_delete_after_acceptance
used to be false
. That means, if someone created a new competition and then ignored the relevant field in the form ("I know it's false by default, which matches what I always want for my competitions, so I just scroll over it") competitors would not be allowed to cancel.
That same behavior would now lead to the competitors being allowed to cancel anytime under any circumstances (default value for competitor_can_cancel
is 0
which translates to :always
). So the person from my first example who casually creates a competition might run into a complete misunderstanding.
Now of course we want to live in an ideal world where every Delegate and every organizers reads the full form carefully. But we are both adult enough to know how many people consciously read a 5-screen-long webform (that they use on a weekly basis) in great detail every single time. But this is something even WCAT (whose job it is to read the forms carefully) cannot catch easily because they don't know what the Delegate's original intention was. From WCAT's perspective, the default choice in the dropdown (when you ignore the field and don't touch it) could be the legitimate, willful intention of the Delegate who submitted the form.
Options:
- Send an email. Hope people will read it.
- Change the defaults around
- Please don't pick a non-zero default value for the raw DB column. Change the order of enum entries if anything
- Rename the whole enum again (not preferrable because we had already settled on a good name)
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.
Another comment, indicating that we (probably?) need a fourth never
state in the enum. And then we could fix my previous concerns rather easily by flipping the order of entries in the enum around, i.e. listing the new never
first.
That would mean that peeps who rely on the default value get the exact same behavior as it used to be with the old boolean implementation
else | ||
false |
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.
FWIW this state is unreachable. Rails enum
introduces validations under the hood that make sure you can never set any (in this case, integer) value that is not covered by the enum.
Do we want cases where the cancellation policy is just "straight-out nope"? In that case, we need a separate never
enum constant.
I'm adding an enum so that we can give organizers more control over which users can cancel their registrations.
TODO:
use_wca_registration
)restrict_any_paid
field - this is where we add the new feature of preventing cancellations by users who have paidThis will deprecate
allow_self_delete_after_acceptance
, which we can remove in a follow-up migration after a few weeks of this running without issue in the wild.