Add more template context for email previews

just to keep things from breaking outright..although this hasn't been given
much attention still, numbers may not make total sense
This commit is contained in:
Lance Edgar 2018-10-31 17:20:35 -05:00
parent 3b14a0b288
commit c45baaed5e

View file

@ -40,17 +40,22 @@ class TempmonBase(object):
def sample_data(self, request):
now = localtime(self.config)
client = model.TempmonClient(config_key='testclient', hostname='testclient')
probe = model.TempmonProbe(config_key='testprobe', description="Test Probe")
client = tempmon.Client(config_key='testclient', hostname='testclient')
probe = tempmon.Probe(config_key='testprobe', description="Test Probe",
good_max_timeout=45)
client.probes.append(probe)
return {
'client': client,
'probe': probe,
'probe_url': '#',
'status': self.enum.TEMPMON_PROBE_STATUS[self.enum.TEMPMON_PROBE_STATUS_ERROR],
'reading': model.TempmonReading(),
'reading': tempmon.Reading(),
'taken': now,
'now': now,
'probe_url': '#',
'status_since': now.strftime('%I:%M %p'),
'status_since_delta': 'now',
'recent_minutes': 90,
'recent_readings': [],
}