Add optional due date to required assets #1962
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new
DateFieldto required assets for due date. If it's past the asset's due date, the input will be disabled for the user to enter with data in the sponsorship detail page.Besides that, the PR adds a new Django command to check for assets that will reach the due date in 7 days (by default, but can be passed as argument). Then, an email is sent to the user with the link to the respective sponsorship detail page so they can fulfill their application. The command always asks for a manual confirmation before sending the email, but if you want to use it under a cron job, you must use the
--no-inputflag to skip the confirmation. Here's a sample on how to use itpython manage.py check_sponsorship_assets_due_date 7 --no-input.Here's a sample of the email's content that I got from the terminal:
PS: Sorry for the PR being polluted by commits from #1959, but since this PR also has migrations, I started the work from that branch to avoid complex migrations corrections. I recommend you to review the PR by the commits.