Return always array in prediction_windows function
parent
bf6a8af5e9
commit
90eef7a00f
|
@ -390,11 +390,11 @@ def prediction_windows(request, sat_id, transmitter, start_date, end_date,
|
|||
try:
|
||||
tr, azr, tt, altt, ts, azs = observer.next_pass(satellite)
|
||||
except ValueError:
|
||||
data = {
|
||||
'error': 'That satellite seems to stay always below your horizon.'
|
||||
}
|
||||
if len(stations) == 1:
|
||||
data = [{
|
||||
'error': 'That satellite seems to stay always below your horizon.'
|
||||
}]
|
||||
break
|
||||
|
||||
# no match if the sat will not rise above the configured min horizon
|
||||
elevation = format(math.degrees(altt), '.0f')
|
||||
if ephem.Date(tr).datetime() < end_date:
|
||||
|
|
|
@ -64,8 +64,8 @@ $(document).ready( function(){
|
|||
beforeSend: function() { $('#loading').show(); }
|
||||
}).done(function(data) {
|
||||
$('#loading').hide();
|
||||
if (data.error) {
|
||||
var error_msg = data.error;
|
||||
if (data.length == 1 && data[0].error) {
|
||||
var error_msg = data[0].error;
|
||||
$('#windows-data').html('<span class="text-danger">' + error_msg + '</span>');
|
||||
} else {
|
||||
var dc = 0; // Data counter
|
||||
|
|
Loading…
Reference in New Issue