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

Fix helloasso #410

Merged
merged 2 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ You must create [user custom attribute](https://admin.google.com/ac/customschema
}
```

## Hello asso
## HelloAsso
[Documentation](https://centredaide.helloasso.com/s/article/api-comment-fonctionne-l-api-helloasso)

Custom fields
Custom fields (Actually hard-coded)
```json
{
"name": "Pseudonyme",
Expand Down Expand Up @@ -64,7 +64,9 @@ Custom fields
"type": "YesNo",
}
```

To use the commands, please provide the requested form slug. \
For exemple, for form at `helloasso.com/associations/masuperassociation/adhesions/adhesion-2024-2025/` , the slug is `adhesion-2024-2025` \
Resulting in, for exemple, the following command : `/ha_check_update form_slug:adhesion-2024-2025`
# Install

```bash
Expand All @@ -91,7 +93,7 @@ python3 -m les_louisdelatech.main -c config.toml -g google.json
# Dev
Install [uv](https://docs.astral.sh/uv/getting-started/installation/)

Install and setup dependencies with `uv sync`
Install and setup dependencies with `uv sync --all-extras`

## Run ruff
```
Expand Down
18 changes: 9 additions & 9 deletions src/les_louisdelatech/utils/User.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,21 @@ def from_hello_asso(cls, order: Dict):
item["phone"] = custom_field["answer"]
elif "Taille du tee-shirt" == custom_field["name"]:
item["tee_shirt"] = custom_field["answer"]
elif (
"Je m'engage à signer l'engagement de confidentialité"
in custom_field["name"]
):
item["confidentiality"] = custom_field["answer"]
# elif (
# "Je m'engage à signer l'engagement de confidentialité"
# in custom_field["name"]
# ):
# item["confidentiality"] = custom_field["answer"]
break

if item is None:
raise LouisDeLaTechError(
f"{order['payer']['firstName']} {order['payer']['lastName']} no valid membership found (or not processed)"
)
elif item["confidentiality"] == "Non":
raise LouisDeLaTechError(
f"{order['payer']['firstName']} {order['payer']['lastName']} disagree to sign the confidentiality agreement"
)
# elif item["confidentiality"] == "Non":
# raise LouisDeLaTechError(
# f"{order['payer']['firstName']} {order['payer']['lastName']} disagree to sign the confidentiality agreement"
# )

return cls(
item["firstname"],
Expand Down