def notification_html(notification_type, name):
config = json.loads(request.args.get('config', 'null'))
session = Session()
not_builder = NotificationBuilder()
if notification_type == 'new_event':
# get the two most recent events
events = session.query(Event).all()
events = events[-2:]
html = not_builder.build_new_event_html(events=events, name=name, web=True, config=config)
else:
# get the most recent shakemap
sms = session.query(ShakeMap).all()
sm = sms[-1]
html = not_builder.build_insp_html(sm, name=name, web=True, config=config)
Session.remove()
return html
评论列表
文章目录