Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events calendar update not working correctly if start time == end time #2021

Closed
malemburg opened this issue Apr 7, 2022 · 0 comments · Fixed by #2024
Closed

Events calendar update not working correctly if start time == end time #2021

malemburg opened this issue Apr 7, 2022 · 0 comments · Fixed by #2024
Labels
app/events Relates to the calendars and events app bug This is a bug!

Comments

@malemburg
Copy link
Member

See Sentry https://sentry.io/organizations/python-software-foundation/issues/3162539277/?project=39935&query=is%3Aunresolved+event&statsPeriod=14d for details.

KeyError: 'DTEND'
  File "/app/manage.py", line 22, in <module>
    main()
  File "/app/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "events/management/commands/import_ics_calendars.py", line 18, in handle
    calendar.import_events()
  File "events/models.py", line 45, in import_events
    importer.import_events()
  File "events/importer.py", line 63, in import_events
    return self.import_events_from_text(ical)
  File "events/importer.py", line 72, in import_events_from_text
    self.import_event(event)
  File "events/importer.py", line 53, in import_event
    self.import_occurrence(event, event_data)
  File "events/importer.py", line 21, in import_occurrence
    dt_end = extract_date_or_datetime(event_data['DTEND'].dt)
  File "icalendar/caselessdict.py", line 42, in __getitem__
    return super(CaselessDict, self).__getitem__(key.upper())

The event in question uses the same value for start and end time (by mistake). This causes the above traceback. Apparently, such entries don't receive a DTEND entry from Google's API.

@malemburg malemburg added bug This is a bug! app/events Relates to the calendars and events app labels Apr 7, 2022
malemburg added a commit to malemburg/pythondotorg that referenced this issue Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app/events Relates to the calendars and events app bug This is a bug!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant