Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
google calendar scraper: set empty string in what field as it doesn't…
Browse files Browse the repository at this point in the history
… allow nulls
  • Loading branch information
OriHoch committed Apr 1, 2017
1 parent fba45f1 commit 2b036f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions events/scrapers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2b036f9

Please sign in to comment.