Skip to content

Commit

Permalink
fixed 'filter' error
Browse files Browse the repository at this point in the history
  • Loading branch information
Foroxon committed Dec 3, 2024
1 parent 656b3e6 commit acb534d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deploy/websocket_server/websocket_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async def alerts_data(websocket, client, shared_data, alert_version):
if client["bins"] != shared_data.bins:
temp_bins = json.loads(shared_data.bins)
if client["firmware"].startswith("3.") or client["firmware"].startswith("2.") or client["firmware"].startswith("1."):
temp_bins = filter(lambda bin: not bin.startswith("4."), temp_bins)
temp_bins = list(filter(lambda bin: not bin.startswith("4."), temp_bins))
temp_bins.append("latest.bin")
payload = '{"payload": "bins", "bins": %s}' % temp_bins
await websocket.send(payload)
Expand All @@ -138,7 +138,7 @@ async def alerts_data(websocket, client, shared_data, alert_version):
if client["test_bins"] != shared_data.test_bins:
temp_bins = json.loads(shared_data.test_bins)
if client["firmware"].startswith("3.") or client["firmware"].startswith("2.") or client["firmware"].startswith("1."):
temp_bins = filter(lambda bin: not bin.startswith("4."), temp_bins)
temp_bins = list(filter(lambda bin: not bin.startswith("4."), temp_bins))
temp_bins.append("latest_beta.bin")
payload = '{"payload": "test_bins", "test_bins": %s}' % temp_bins
await websocket.send(payload)
Expand Down

0 comments on commit acb534d

Please sign in to comment.