Closed blreams closed 8 years ago
This is partially completed. I created a new function in models, get_pick_deadline() that does the following:
Doing it this way does not require changing the Game model to make kickoff a required field. It doesn't require changing any of the models, which I will not do until after the season is over. The only other remaining piece is to remove pick_deadline as a field to be entered, but for now I'm keeping it shown just so the commissioners know what value it has in the model without consulting the Admin interface.
I made a few additional modifications to insure that the initial submit of the create/edit week form will calculate the earliest kickoff from the cleaned form entries and do a second Week object save with that as the pick deadline. Also, I was able to set the kickoff field for each game as a required form field. This insures that the submit is not successful unless all the kickoffs are filled in. Likewise, I was able to set the pick_deadline field as not required...allowing it to be blank when the form is submitted. Neither of those changes (required/not required) necessitates a change to the model or existing records, so I'm ok with making this change during the season since there would be no db migration.
Closing
This would require removing Pick Deadline as an input to the form. Would need to change kickoff to make it required. Then figure out how to set pick deadline based on validated form input.