Skip to content
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

[Dépôt de besoin] Admin : ajout de validation sur les règles de ciblage par km #1011

Merged

Conversation

raphodn
Copy link
Contributor

@raphodn raphodn commented Dec 7, 2023

Quoi ?

Suite de #999

Cette PR a introduit un nouveau champ distance_location et quelques mini règles pour que le ciblage se passe bien.

J'ai rajouté ces règles dans le clean du formulaire admin, pour renvoyer des ValidationError si jamais elle n'étaient pas respectées

@raphodn raphodn self-assigned this Dec 7, 2023
@raphodn raphodn force-pushed the raphodn/tender-target-distance-around-city-admin-validation branch from 30863c3 to 23d8777 Compare December 7, 2023 10:29
Copy link
Contributor

@SebastienReuiller SebastienReuiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top ! C'est moins fourbe ainsi 😉

if distance_location:
location = cleaned_data.get("location")
if not location:
raise ValidationError({"location": "Distance en km est spécifié, ce champ doit donc être rempli"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'aurai peut-être mis : "La distance en km est spécifiée" ou Le champs "Distance en km" est spécifié

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'ai amélioré 👍

@raphodn raphodn merged commit add2f19 into master Dec 7, 2023
4 checks passed
@raphodn raphodn deleted the raphodn/tender-target-distance-around-city-admin-validation branch December 7, 2023 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants