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

Admin: Robustifier le changement d'état des candidatures #4244

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

tonial
Copy link
Contributor

@tonial tonial commented Jun 17, 2024

🤔 Pourquoi ?

Force le fait de passer par les transitions d'état et l'envoi des emails correspondants.

Impact pour le support :

  • les nouvelles candidatures ne peuvent être qu'au statut accepté
  • les vérifications de transition sont les mêmes que précédement

TODO:

  • Ajouter des tests (attendre le retour du support et des devs pour valider la proposition)

💻 Captures d'écran

🚨 À vérifier

  • Mettre à jour le CHANGELOG_breaking_changes.md ?

🏝️ Comment tester

Les instructions pour reproduire le problème, les profils de test, le parcours spécifique à utiliser, etc. Si vous disposez d'une recette jetable, mettre l'URL pour tester dans cette partie.

@tonial tonial self-assigned this Jun 17, 2024
@tonial tonial force-pushed the alaurent/job_app_admin_actions branch from 155277a to 123d244 Compare June 17, 2024 14:01
@tonial tonial added the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label Jun 17, 2024
@tonial tonial force-pushed the alaurent/job_app_admin_actions branch 2 times, most recently from 8f8ea6a to 8cbde3b Compare June 17, 2024 14:32
Copy link
Contributor

@rsebille rsebille left a comment

Choose a reason for hiding this comment

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

J'avais en tête que Xavier avec fait un truc où la logique était de regarder si la valeur de state changeait et si c'était le cas alors d'appeler la transition, mais impossible de retrouver 😵.

itou/job_applications/admin.py Outdated Show resolved Hide resolved
itou/templates/admin/job_applications/change_form.html Outdated Show resolved Hide resolved
itou/templates/admin/job_applications/change_form.html Outdated Show resolved Hide resolved
itou/templates/admin/job_applications/change_form.html Outdated Show resolved Hide resolved
itou/templates/admin/job_applications/change_form.html Outdated Show resolved Hide resolved
@tonial tonial force-pushed the alaurent/job_app_admin_actions branch 5 times, most recently from b3e8875 to da63e24 Compare June 18, 2024 12:46
@tonial tonial added 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC and removed 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC labels Jun 18, 2024
Copy link

🥁 La recette jetable est prête ! 👉 Je veux tester cette PR !

@tonial tonial force-pushed the alaurent/job_app_admin_actions branch 4 times, most recently from 84bb5c1 to f238541 Compare June 20, 2024 14:24
@tonial tonial requested a review from rsebille June 20, 2024 14:25
Comment on lines 290 to 295
if error.args[0] == "Cannot create an approval without eligibility diagnosis here":
message = (
"Un diagnostic d'éligibilité valide pour ce candidat "
"et cette SIAE est obligatoire pour pouvoir créer un PASS IAE."
)
elif error.args[0] == "Cannot accept a job application with no hiring start date.":
Copy link
Contributor

Choose a reason for hiding this comment

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

Pour les args[0] == ne faudrait-il pas utiliser une constante pour que ça soit toujours synchroniser avec ce qui est levé dans les AbortTransition ?
Ou alors peut-être remplacer le texte en anglais par le français ? J'ai l'impression que c'est fait comme ça à d'autre endroit, et c'est peut-être la philosophie attendu 🤷.

Copy link
Contributor

Choose a reason for hiding this comment

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

Je seconde l'utilisation d'une constante pour garder la synchro.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Je pars sur la constante parce que le message dans l'admin est un peu adapté pour le support

itou/job_applications/admin.py Outdated Show resolved Hide resolved
tests/job_applications/test_admin.py Outdated Show resolved Hide resolved
tests/job_applications/test_admin.py Outdated Show resolved Hide resolved
Comment on lines 290 to 295
if error.args[0] == "Cannot create an approval without eligibility diagnosis here":
message = (
"Un diagnostic d'éligibilité valide pour ce candidat "
"et cette SIAE est obligatoire pour pouvoir créer un PASS IAE."
)
elif error.args[0] == "Cannot accept a job application with no hiring start date.":
Copy link
Contributor

Choose a reason for hiding this comment

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

Je seconde l'utilisation d'une constante pour garder la synchro.

tests/job_applications/test_admin.py Outdated Show resolved Hide resolved
@tonial tonial force-pushed the alaurent/job_app_admin_actions branch 2 times, most recently from d6f4cf6 to f896996 Compare June 24, 2024 08:17
@tonial
Copy link
Contributor Author

tonial commented Jun 24, 2024

merci pour les relectures

@tonial tonial enabled auto-merge June 24, 2024 08:17
@tonial tonial force-pushed the alaurent/job_app_admin_actions branch from f896996 to 7c5333f Compare June 24, 2024 08:18
@tonial tonial force-pushed the alaurent/job_app_admin_actions branch from 7c5333f to d62f327 Compare June 24, 2024 08:48
@tonial tonial added this pull request to the merge queue Jun 24, 2024
Merged via the queue into master with commit d847bed Jun 24, 2024
11 checks passed
@tonial tonial deleted the alaurent/job_app_admin_actions branch June 24, 2024 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC modifié
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants