1.1 --- a/tools/invite.py Tue Sep 19 17:27:16 2017 +0200
1.2 +++ b/tools/invite.py Tue Sep 19 23:45:57 2017 +0200
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Prepare an invitation message.
1.6
1.7 -Copyright (C) 2016 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -44,11 +44,18 @@
1.13 if not recipients:
1.14 raise ValueError("Recipients must be specified.")
1.15
1.16 + # Obtain a timezone.
1.17 +
1.18 + if len(tzids) > 1:
1.19 + raise ValueError("Only one timezone identifier should be given.")
1.20 +
1.21 + tzid = tzids and tzids[0] or get_default_timezone()
1.22 +
1.23 organiser = organisers[0]
1.24
1.25 # Create an event for the calendar with the organiser and attendee details.
1.26
1.27 - e = new_object("VEVENT")
1.28 + e = new_object("VEVENT", tzid)
1.29 e["UID"] = [(make_uid(organiser), {})]
1.30 e["ORGANIZER"] = [(organiser, {})]
1.31
1.32 @@ -62,13 +69,6 @@
1.33
1.34 e["ATTENDEE"] = attendees
1.35
1.36 - # Obtain a timezone.
1.37 -
1.38 - if len(tzids) > 1:
1.39 - raise ValueError("Only one timezone identifier should be given.")
1.40 -
1.41 - tzid = tzids and tzids[0] or get_default_timezone()
1.42 -
1.43 # Obtain the event periods converting them to datetimes.
1.44
1.45 if not from_datetimes: