Merge branch 'performance-improvements' into 'master'
Hot fix for scheduling permission and automatic calculation See merge request librespacefoundation/satnogs/satnogs-network!796merge-requests/796/merge
commit
33d143ce19
|
@ -70,7 +70,11 @@ def schedule_stations_perms(user, stations):
|
|||
# User has online station (status=2) and station is online
|
||||
try:
|
||||
if user.ground_stations.filter(status=2).exists():
|
||||
return {station.id: station.status == 2 for station in stations}
|
||||
return {
|
||||
s.id: s.status == 2 or (s.owner == user and s.status == 1)
|
||||
for s in stations
|
||||
}
|
||||
|
||||
except ObjectDoesNotExist:
|
||||
pass
|
||||
# If the station is testing (status=1) and user is its owner
|
||||
|
|
|
@ -42,7 +42,7 @@ $(document).ready( function(){
|
|||
`;
|
||||
}
|
||||
|
||||
function select_proper_stations(filters){
|
||||
function select_proper_stations(filters, callback){
|
||||
var url = '/scheduling_stations/';
|
||||
var data = {'transmitter': filters.transmitter};
|
||||
if (filters.station) {
|
||||
|
@ -88,6 +88,9 @@ $(document).ready( function(){
|
|||
</option>`).prop('disabled', true);
|
||||
$('#station-selection').selectpicker('refresh');
|
||||
}
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
$('#station-field-loading').hide();
|
||||
$('#station-field').show();
|
||||
});
|
||||
|
@ -195,7 +198,9 @@ $(document).ready( function(){
|
|||
$('#transmitter-selection').selectpicker('refresh');
|
||||
}
|
||||
if (callback) {
|
||||
callback();
|
||||
select_proper_stations(filters,callback);
|
||||
} else {
|
||||
select_proper_stations(filters);
|
||||
}
|
||||
$('#transmitter-field-loading').hide();
|
||||
$('#transmitter-field').show();
|
||||
|
|
Loading…
Reference in New Issue