Candidatures : Indiquer la date minimale pour les champs début et fin de contrat#4597
Merged
Conversation
rsebille
reviewed
Aug 26, 2024
| self.fields["hiring_start_at"].required = True | ||
| for field in ["hiring_start_at", "hiring_end_at"]: | ||
| self.fields[field].widget = DuetDatePickerWidget() | ||
| self.fields[field].widget = DuetDatePickerWidget(attrs={"min": timezone.localdate().isoformat()}) |
Contributor
There was a problem hiding this comment.
Si j'en crois .clean_hiring_start_at(), les GEIQ peuvent embaucher rétroactivement, mais on veux peut-être supprimé cela maintenant que ça fait quelque temps que c'est ouvert pour eux.
Et peut-être aussi ajouter le max pour hiring_start_at au passage 🤷.
Member
Author
There was a problem hiding this comment.
Bien vu. Apparemment, on ne supprime pas : https://itou-inclusion.slack.com/archives/C01AQKD7MAN/p1724671235188319?thread_ts=1724669159.511739&cid=C01AQKD7MAN
Be more helpful to users.
38493bb to
c56d8ab
Compare
rsebille
approved these changes
Aug 26, 2024
| if not self.is_geiq: | ||
| today = timezone.localdate() | ||
| attrs_min["min"] = today.isoformat() | ||
| attrs_max["max"] = (today + relativedelta(months=6)).isoformat() |
Contributor
There was a problem hiding this comment.
L'erreur dans le futur est commune ;).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🤔 Pourquoi ?
Évite des erreurs utilisateurs.