1
0
Fork 0

Fix scheduling permissions for user with online and testing stations

Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
merge-requests/796/head
Alfredos-Panagiotis Damkalis 2019-11-29 00:08:52 +02:00
parent 7506c87e0e
commit 01dc6a1cd4
1 changed files with 5 additions and 1 deletions

View File

@ -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