Fix scheduling permissions for user with online and testing stations
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>merge-requests/796/head
parent
7506c87e0e
commit
01dc6a1cd4
|
@ -70,7 +70,11 @@ def schedule_stations_perms(user, stations):
|
||||||
# User has online station (status=2) and station is online
|
# User has online station (status=2) and station is online
|
||||||
try:
|
try:
|
||||||
if user.ground_stations.filter(status=2).exists():
|
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:
|
except ObjectDoesNotExist:
|
||||||
pass
|
pass
|
||||||
# If the station is testing (status=1) and user is its owner
|
# If the station is testing (status=1) and user is its owner
|
||||||
|
|
Loading…
Reference in New Issue