'Get a list of dicts with start and end fields with datetime values from
the discussion_blackouts setting'

def get_discussion_blackout_datetimes(self):

    date_proxy = Date()
    try:
        ret = [{'start': date_proxy.from_json(start), 'end': date_proxy.from_json(end)} for (start, end) in filter(None, self.discussion_blackouts)]
        for blackout in ret:
            if ((not blackout['start']) or (not blackout['end'])):
                raise ValueError
        return ret
    except (TypeError, ValueError):
        log.info('Error    parsing    discussion_blackouts    %s    for    course    %s', self.discussion_blackouts, self.id)
        return []
