From 2b036f93cd3fd8e390b60f46a89d583ae46cacfd Mon Sep 17 00:00:00 2001 From: Ori Hoch Date: Sat, 1 Apr 2017 12:57:49 +0300 Subject: [PATCH] google calendar scraper: set empty string in what field as it doesn't allow nulls --- events/scrapers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/events/scrapers.py b/events/scrapers.py index f7a6b542..c361b849 100644 --- a/events/scrapers.py +++ b/events/scrapers.py @@ -78,10 +78,11 @@ def _process_items(self, person, items): colorId = item['colorId'] if 'colorId' in item else None data = unicode(item) kwargs = { - 'when': start_date, 'when_over': end_date, 'link': link, 'what': summary, 'why': description, + 'when': start_date, 'when_over': end_date, 'link': link, + 'what': summary if summary else "", # what field in DB doesn't allow null value + 'why': description, # why field allows null 'update_date': update_date, } - res = Event.objects.filter(icaluid=icaluid) event, created = Event.objects.get_or_create(icaluid=icaluid, defaults=kwargs) event.who.add(person) if created: