Commit 3c98ba91 authored by Tom Kunze's avatar Tom Kunze
Browse files

server: Fix missing temperatures in tutormode

parent 580592e6
...@@ -451,7 +451,13 @@ function fillTimetable(data){ ...@@ -451,7 +451,13 @@ function fillTimetable(data){
function setTemperature(data) { function setTemperature(data) {
var room = getCurrentRoom(); var room = getCurrentRoom();
var temperature = data.temperatures[room]; var temperature = 'N/A';
if (data.temperatures !== undefined && room in data.temperatures) {
temperature = data.temperatures[room];
} else {
console.log('Room ' + room + ' has no temperature!');
}
$('#current_temp').text(temperature); $('#current_temp').text(temperature);
} }
......
...@@ -303,6 +303,7 @@ def _requests(request, send_hostname=None): ...@@ -303,6 +303,7 @@ def _requests(request, send_hostname=None):
data['exercises'] = _get_lectures_now() data['exercises'] = _get_lectures_now()
data['exercises_today'] = _get_lectures_today() data['exercises_today'] = _get_lectures_today()
data['configuration'] = _get_lecture_configuration() data['configuration'] = _get_lecture_configuration()
data['temperatures'] = _get_temperatures()
indent = None indent = None
if settings.DEBUG: if settings.DEBUG:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment