-
Notifications
You must be signed in to change notification settings - Fork 41
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
(PC-32840)[API] feat: prevent young users from using ineligible postal codes #15714
Conversation
Visit the preview URL for this PR (updated for commit 98fd6c4): https://pc-pro-testing--pr15714-pc-32840-exclude-nor-tgn59xuw.web.app (expires Thu, 23 Jan 2025 08:57:15 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 032d233ee67e1c50d6af12e29c936c7076770eb1 |
f5af68c
to
cd68326
Compare
cd68326
to
fa45a5c
Compare
api/src/pcapi/utils/postal_code.py
Outdated
NORTH_CALEDONIAN_POSTAL_CODES = { | ||
"98811": "Bélep", | ||
"98813": "Canala", | ||
"98815": "Hienghène", | ||
"98816": "Houaïlou", | ||
"98817": "Kaala-Gomen", | ||
"98818": "Kouaoua", | ||
"98821": "Ouégoa", | ||
"98822": "Poindimié", | ||
"98823": "Ponérihouen", | ||
"98824": "Pouébo", | ||
"98825": "Pouembout", | ||
"98826": "Poum", | ||
"98831": "Touho", | ||
"98833": "Voh", | ||
"98850": "Koumac", | ||
"98860": "Koné", | ||
} |
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.
Une collection des seuls codes postaux ne serait-elle pas suffisante ? A priori on n'utilise nulle part le nom de la commune.
fa45a5c
to
df33462
Compare
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.
Ok
Hormis je ne comprend pas d'où sort le accountUnsuspensionLimit
account_creation_minimum_age: int | ||
account_unsuspension_limit: int |
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.
Quel rapport avec cette PR ?
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.
erreur de rebase avec le tri des clés :'(
df33462
to
10dcdff
Compare
e7a896c
to
a43b774
Compare
if ( | ||
"postal_code" in profile_update_dict | ||
and profile_update_dict["postal_code"] in postal_code_utils.INELIGIBLE_POSTAL_CODES | ||
): |
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.
Détail : proposition plus simple :
if ( | |
"postal_code" in profile_update_dict | |
and profile_update_dict["postal_code"] in postal_code_utils.INELIGIBLE_POSTAL_CODES | |
): | |
if profile_update_dict.get("postal_code") in postal_code_utils.INELIGIBLE_POSTAL_CODES: |
api/src/pcapi/utils/postal_code.py
Outdated
"98850", # Koumac | ||
"98860", # Koné | ||
] | ||
LOYALTY_ISLAND_POSTAL_CODES = [ |
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.
LOYALTY_ISLAND_POSTAL_CODES = [ | |
LOYALTY_ISLANDS_POSTAL_CODES = [ |
a43b774
to
98fd6c4
Compare
But de la pull request
Ticket Jira (ou description si BSR) : https://passculture.atlassian.net/browse/PC-32840