Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
Change to base64 utf-8 encoding.
Browse files Browse the repository at this point in the history
Remove empty lines from ics invite.
  • Loading branch information
kunerj committed Oct 14, 2023
1 parent 110b456 commit bc2ec80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions amivapi/templates/events_accepted_calendar_invite.ics
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ UID:{{ event_id }}@amiv.ethz.ch
ORGANIZER;CN=MAILTO:{{ reply_to_email }}
LOCATION:{{ location }}
SUMMARY:{{ title_en }}
{% if signup_additional_info_en is not none and signup_additional_info_en|length %}
{% if signup_additional_info_en is not none and signup_additional_info_en|length -%}
DESCRIPTION:{{ signup_additional_info_en }}\n\n{{ description_en }}
{% else %}
{% else -%}
DESCRIPTION:{{ description_en }}
{% endif %}
{% endif -%}
CLASS:PUBLIC
DTSTART;TZID=Europe/Berlin:{{ time_start.strftime('%Y%m%dT%H%M%S') }}
DTEND;TZID=Europe/Berlin:{{ time_end.strftime('%Y%m%dT%H%M%S') }}
Expand Down
4 changes: 2 additions & 2 deletions amivapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ def mail(to, subject, text, html=None, reply_to=None, calendar_invite=None):
msg.attach(MIMEText(text))

if calendar_invite is not None:
calendar_mime = MIMEText(calendar_invite, 'calendar')
calendar_mime = MIMEText(calendar_invite, 'calendar', "utf-8")
calendar_mime['Content-Disposition'] = (
'attachment; filename="invite.ics", charset="utf-8"; method=PUBLISH')
'attachment; filename="invite.ics"; charset="utf-8"; method=PUBLISH')
msg.attach(calendar_mime)

msg['Subject'] = subject
Expand Down

0 comments on commit bc2ec80

Please sign in to comment.