From 639c8c295cad6c9b2ba9195d67c9e0fecc291679 Mon Sep 17 00:00:00 2001 From: Thomas NOEL Date: Mon, 27 Aug 2018 21:03:18 +0200 Subject: [PATCH] handle exception vevent without summary (#25887) --- chrono/agendas/models.py | 5 ++++- tests/test_agendas.py | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/chrono/agendas/models.py b/chrono/agendas/models.py index 4d0c7dc..16a2f06 100644 --- a/chrono/agendas/models.py +++ b/chrono/agendas/models.py @@ -493,7 +493,10 @@ class Desk(models.Model): with transaction.atomic(): update_datetime = now() for vevent in parsed.contents.get('vevent', []): - summary = force_text(vevent.contents['summary'][0].value) + if 'summary' in vevent.contents: + summary = force_text(vevent.contents['summary'][0].value) + else: + summary = _('Exception') try: start_dt = vevent.dtstart.value if not isinstance(start_dt, datetime.datetime): diff --git a/tests/test_agendas.py b/tests/test_agendas.py index 76bee94..4b31e17 100644 --- a/tests/test_agendas.py +++ b/tests/test_agendas.py @@ -31,7 +31,6 @@ UID:950c3ff889d2465dd5d648c4c2194232c0a565f4 DTSTART:20170830T180800Z DTEND:20170831T223400Z SEQUENCE:2 -SUMMARY:Event 2 END:VEVENT END:VCALENDAR""" -- 2.18.0