Skip to content

Conversation

@Armadillan
Copy link
Contributor

@Armadillan Armadillan commented Dec 21, 2025

Surely this well tested code doesnt break anything.

Pls especially double check mailer/bilf_mailer.py line 51

@Armadillan
Copy link
Contributor Author

Should resolve #450

@Armadillan Armadillan changed the title send email to bilf on new booking (fsek#450) send email to bilf on new booking (#450) Dec 21, 2025
@Armadillan Armadillan closed this Dec 21, 2025
@Armadillan

This comment was marked as resolved.

@Armadillan
Copy link
Contributor Author

Surely I've fixed all the bugs now. Looks green on my end idk.

@Armadillan Armadillan reopened this Dec 21, 2025
Copy link
Member

@maffe03 maffe03 left a comment

Choose a reason for hiding this comment

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

Thanks for the help!
I think it might be better to duplicate some code rather than mess with the User_DB objects as they are scary and might do Database Stuff™, but overall it's good!

msg["Subject"] = "Ny kollegie-bilbokning / New council car booking"

# This will surely be super bad
fake_user = User_DB(
Copy link
Member

Choose a reason for hiding this comment

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

Probably better to just create a new send_mail_to_adress function instead which takes in an EmailStr instead of User_DB

html = html.replace("{{ booking.time }}", time_string)

if booking.council is not None:
html = html.replace("{{ booking.council_en }}", booking.council.name_en)
Copy link
Member

Choose a reason for hiding this comment

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

Probably unnecessary but maybe escape these as well? This is technically (admin) user input.

Copy link
Member

@maffe03 maffe03 left a comment

Choose a reason for hiding this comment

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

LGTM

@maffe03 maffe03 merged commit 1346a91 into fsek:main Dec 23, 2025
1 check passed
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.

2 participants