Files
edx-platform/openedx/features/calendar_sync/__init__.py
Michael Terry 4c241e57fe Add func to generate ics for schedule
This is an unused-as-of-yet utility function to generate a bunch
of ics files for a user's course schedule. Will be used as part
of the calendar_sync feature package.

AA-37
2020-03-16 10:51:51 -04:00

19 lines
628 B
Python

"""
Calendar syncing Course dates with a User.
"""
def get_calendar_event_id(user, block_key, date_type, hostname):
"""
Creates a unique event id based on a user and a course block key
Parameters:
user (User): The user requesting a calendar event
block_key (str): The block key containing the date for the calendar event
date_type (str): The type of the date (e.g. 'due', 'start', 'end', etc.)
hostname (str): A hostname to namespace this id (e.g. 'open.edx.org')
Returns:
event id (str)
"""
return '{}.{}.{}@{}'.format(user.id, block_key, date_type, hostname)