Skip to content

Commit f7ae976

Browse files
author
soest
committed
Change order of roster check
1 parent 89ec75f commit f7ae976

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

monitor/monitor_login.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ def check_connection(connection: dict, station_data: list[dict], solos: list[dic
7878
f'No station found {connection["callsign"]}',
7979
f'Station {connection["callsign"]} not found')
8080

81+
if connection['rating'] == 2 and connection['cid'] in theory_roster and not safe_get(data, 's1_theory'):
82+
return output_dict(False,
83+
f'Someone is controlling station {connection["callsign"]} on theory only roster.',
84+
f'You cannot control {connection["callsign"]} as it is not a theory only station.')
85+
8186
# Rating check
8287
station_type = data['logon'].split('_')[-1]
8388
if required_rating[station_type] > connection['rating']:
@@ -137,13 +142,7 @@ def check_connection(connection: dict, station_data: list[dict], solos: list[dic
137142
f'Someone has neither solo nor tier 1 endorsement for {connection["callsign"]}.',
138143
f'You need an endorsement for {connection["callsign"]}.')
139144
else:
140-
# Theory only roster check
141-
if connection['rating'] == 2 and connection['cid'] in theory_roster and not safe_get(data, 's1_theory'):
142-
return output_dict(False,
143-
f'Someone is controlling station {connection["callsign"]} on theory only roster.',
144-
f'You cannot control {connection["callsign"]} as it is not a theory only station.')
145-
else:
146-
return output_dict(True, '', f'You may control {data["logon"]}.')
145+
return output_dict(True, '', f'You may control {data["logon"]}.')
147146

148147

149148
if __name__ == '__main__':

0 commit comments

Comments
 (0)