Projet

Général

Profil

0001-handle-exception-vevent-without-summary-25887.patch

Thomas Noël, 27 août 2018 21:03

Télécharger (1,39 ko)

Voir les différences:

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(-)
chrono/agendas/models.py
493 493
        with transaction.atomic():
494 494
            update_datetime = now()
495 495
            for vevent in parsed.contents.get('vevent', []):
496
                summary = force_text(vevent.contents['summary'][0].value)
496
                if 'summary' in vevent.contents:
497
                    summary = force_text(vevent.contents['summary'][0].value)
498
                else:
499
                    summary = _('Exception')
497 500
                try:
498 501
                    start_dt = vevent.dtstart.value
499 502
                    if not isinstance(start_dt, datetime.datetime):
tests/test_agendas.py
31 31
DTSTART:20170830T180800Z
32 32
DTEND:20170831T223400Z
33 33
SEQUENCE:2
34
SUMMARY:Event 2
35 34
END:VEVENT
36 35
END:VCALENDAR"""
37 36

  
38
-