worldcubeassociation.org icon indicating copy to clipboard operation
worldcubeassociation.org copied to clipboard

Allow competitions to be saved (not confirmed) with validation errors

Open timreyn opened this issue 3 years ago • 1 comments

When creating a new competition, there are a lot of fields that need to be filled out. Usually when I create a competition, I just pick random values for these, so that I can save it and give it to the organizer to fill out the real values. Sometimes it takes me 2-3 tries to remember all the fields that need to be filled out, and to get valid values for all of them. For example, if we change the name of the competition, whatever is in the "reason for name" field gets replaced; if we change the competition date, all the registration dates change as well.

Could we make it so that you can save a new competition even if the validations fail? The validations should still show up as warnings on the edit page, and prevent from confirming. But that way the delegate can send it to the organizer, who can fill out all the fields over the next few days / weeks as we plan all the details of the competition.

timreyn avatar Sep 03 '22 00:09 timreyn

I do agree it's extremely annoying to have to figure out what dates to put for validations to work. However I'd rather create some "good" default value when creating the Competition object, than ignoring very relevant validations! (While writing this I just realized it doesn't quite address the "changing the date" part of the comment, but it may be possible to find good default that works when the date is changed to a future date (which is usually the case when cloning a competition).

viroulep avatar Sep 10 '22 15:09 viroulep

This seems reasonable, provided we don't allow competitions to be submitted for approval if validations fail.

dunkOnIT avatar Oct 20 '22 14:10 dunkOnIT

With a bit more understanding of how Rails validations work, this should be possible with .save(validate: false). Will play around with adding a "save as draft" button.

dunkOnIT avatar Mar 21 '23 14:03 dunkOnIT