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

(PC-32840)[API] feat: prevent young users from using ineligible postal codes #15714

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

dnguyen-pass
Copy link
Contributor

But de la pull request

Ticket Jira (ou description si BSR) : https://passculture.atlassian.net/browse/PC-32840

Copy link
Contributor

github-actions bot commented Jan 3, 2025

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

@dnguyen-pass dnguyen-pass force-pushed the PC-32840-exclude-north-caledonia branch 2 times, most recently from f5af68c to cd68326 Compare January 7, 2025 08:43
@dnguyen-pass dnguyen-pass force-pushed the PC-32840-exclude-north-caledonia branch from cd68326 to fa45a5c Compare January 7, 2025 14:35
Comment on lines 15 to 32
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é",
}
Copy link
Contributor

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.

@dnguyen-pass dnguyen-pass force-pushed the PC-32840-exclude-north-caledonia branch from fa45a5c to df33462 Compare January 20, 2025 15:48
Copy link
Contributor

@cnormant-pass cnormant-pass left a 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
Copy link
Contributor

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 ?

Copy link
Contributor Author

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 :'(

@dnguyen-pass dnguyen-pass force-pushed the PC-32840-exclude-north-caledonia branch from df33462 to 10dcdff Compare January 20, 2025 15:54
@dnguyen-pass dnguyen-pass force-pushed the PC-32840-exclude-north-caledonia branch 4 times, most recently from e7a896c to a43b774 Compare January 20, 2025 17:49
Comment on lines 73 to 76
if (
"postal_code" in profile_update_dict
and profile_update_dict["postal_code"] in postal_code_utils.INELIGIBLE_POSTAL_CODES
):
Copy link
Contributor

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 :

Suggested change
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:

"98850", # Koumac
"98860", # Koné
]
LOYALTY_ISLAND_POSTAL_CODES = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
LOYALTY_ISLAND_POSTAL_CODES = [
LOYALTY_ISLANDS_POSTAL_CODES = [

@dnguyen-pass dnguyen-pass force-pushed the PC-32840-exclude-north-caledonia branch from a43b774 to 98fd6c4 Compare January 21, 2025 08:55
@dnguyen-pass dnguyen-pass merged commit 191b8a5 into master Jan 21, 2025
27 of 28 checks passed
@dnguyen-pass dnguyen-pass deleted the PC-32840-exclude-north-caledonia branch January 21, 2025 10:05
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.

4 participants