-
Notifications
You must be signed in to change notification settings - Fork 27
API: Correction d'un serializer de l'api SIAE #4123
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
Conversation
bf1b6a9 to
4c059df
Compare
francoisfreitag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Peut-être avec un test de non régression ?
870287f to
1cbee0a
Compare
|
C'est fait ! |
7f5d6fe to
e68795c
Compare
|
|
||
| def _fix_contract_type_enum(apps, schema_editor): | ||
| JobDescription = apps.get_model("companies", "JobDescription") | ||
| JobDescription.objects.filter(contract_type="FED_TERM_I_PHC").update(contract_type="FIXED_TERM_I_PHC") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il faudrait voir avec le pilotage qui récupère cette donnée:
les-emplois/itou/metabase/tables/job_descriptions.py
Lines 32 to 37 in f332e1d
| { | |
| "name": "type_contrat", | |
| "type": "varchar", | |
| "comment": "Type de contrat proposé", | |
| "fn": lambda o: o.contract_type, | |
| }, |
Quitte à leur mettre une rustine temporaire pour leur re-transformer FIXED_TERM_I_PHC en FED_TERM_I_PHC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je les ai prévenu.
Because ContractType FIXED_TERM_I_PHC is stored as FED_TERM_I_PHC in the database.... Next commit will fix the value in the enum + database
🤔 Pourquoi ?
Parce que
ContractType.FIXED_TERM_I_PHCa pour valeurFED_TERM_I_PHCdans la base de données.Peut-être devrait-on changer cette valeur en db avec une migration en plus de cette amélioration du code ?
cf sentry : https://itou.sentry.io/issues/5132982995/?project=6164438&query=is%3Aunresolved+level%3Aerror&referrer=issue-stream&statsPeriod=14d&stream_index=8
🍰 Comment ?
💻 Captures d'écran
🚨 À vérifier
🏝️ Comment tester