def app_config(): term_id = app.config['CURRENT_TERM_ID'] return tolerant_jsonify({ 'canvasBaseUrl': app.config['CANVAS_BASE_URL'], 'courseCaptureExplainedUrl': app.config['COURSE_CAPTURE_EXPLAINED_URL'], 'courseCapturePoliciesUrl': app.config['COURSE_CAPTURE_POLICIES_URL'], 'currentTermId': term_id, 'currentTermName': term_name_for_sis_id(term_id), 'devAuthEnabled': app.config['DEVELOPER_AUTH_ENABLED'], 'diabloEnv': app.config['DIABLO_ENV'], 'ebEnvironment': app.config['EB_ENVIRONMENT'] if 'EB_ENVIRONMENT' in app.config else None, 'emailTemplateTypes': EmailTemplate.get_template_type_options(), 'publishTypeOptions': NAMES_PER_PUBLISH_TYPE, 'roomCapabilityOptions': Room.get_room_capability_options(), 'searchFilterOptions': get_search_filter_options(), 'searchItemsPerPage': app.config['SEARCH_ITEMS_PER_PAGE'], 'supportEmailAddress': app.config['EMAIL_DIABLO_SUPPORT'], 'timezone': app.config['TIMEZONE'], })
def to_api_json(self): return { 'id': self.id, 'sectionId': self.section_id, 'templateType': self.template_type, 'templateTypeName': EmailTemplate.get_template_type_options()[self.template_type], 'termId': self.term_id, 'createdAt': to_isoformat(self.created_at), }
def description(cls): names_by_type = EmailTemplate.get_template_type_options() template_types = [ 'admin_alert_date_change', 'admin_alert_instructor_change', 'admin_alert_multiple_meeting_patterns', 'admin_alert_room_change', ] return f"""
def app_config(): def _to_api_key(key): chunks = key.split('_') return f"{chunks[0].lower()}{''.join(chunk.title() for chunk in chunks[1:])}" return tolerant_jsonify( { **dict((_to_api_key(key), app.config[key]) for key in PUBLIC_CONFIGS), **{ 'currentTermName': term_name_for_sis_id(app.config['CURRENT_TERM_ID']), 'ebEnvironment': get_eb_environment(), 'emailTemplateTypes': EmailTemplate.get_template_type_options(), 'publishTypeOptions': NAMES_PER_PUBLISH_TYPE, 'roomCapabilityOptions': Room.get_room_capability_options(), 'searchFilterOptions': get_search_filter_options(), }, }, )
def to_api_json(self): return { 'id': self.id, 'recipientUids': self.recipient_uids, 'sectionId': self.section_id, 'templateType': self.template_type, 'templateTypeName': EmailTemplate.get_template_type_options()[self.template_type], 'termId': self.term_id, 'sentAt': to_isoformat(self.sent_at), }