Skip to content

Commit

Permalink
Merge branch 'CompassionCH:14.0' into FIX-T1185-SDS-101-Mycompassion-…
Browse files Browse the repository at this point in the history
…language-display
  • Loading branch information
minedcp authored Apr 8, 2024
2 parents d4ec01c + 2b5fac9 commit 5f8f089
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions my_compassion/controllers/my_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,22 @@ def my_child(self, state="active", child_id=None, **kwargs):
wordpress = (
request.env["wordpress.configuration"].sudo().get_config(raise_error=False)
)
partner_profile_info = {
"child_ref": child.local_id,
"pname": partner.firstname + " " + partner.lastname,
"cname": partner.company_id.name,
"pstreet": partner.street,
"pzip": partner.zip,
"pcity": partner.city,
"pcountry": partner.country_id.name,
"email": partner.email,
# Add any other fields you want to prefill in the form
}
# Construct query string with user profile info
query_string = urlencode(partner_profile_info)
url_child_gift = (
(f"https://{wordpress.host}{wordpress.child_gift_url}")
if wordpress
(f"https://{wordpress.host}{wordpress.child_gift_url}?{query_string}")
if wordpress and partner_profile_info
else "#"
)

Expand Down

0 comments on commit 5f8f089

Please sign in to comment.