Skip to content

Commit

Permalink
Add fix to handle unproperly parsed station names from getStation
Browse files Browse the repository at this point in the history
  • Loading branch information
andreleblanc11 authored and petersilva committed Mar 8, 2024
1 parent 37623d4 commit d2a9b08
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sarracenia/bulletin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import time
import re
from base64 import b64decode

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -157,6 +158,11 @@ def getStation(self, data):
else :
station = ''

# Added to SR3
# The station needs to be alphanumeric, between 3 and 5 characters. If not, don't assign a station
if re.search('^[a-zA-Z0-9]{3,5}$', station) == None:
station = ''

return station


Expand Down

0 comments on commit d2a9b08

Please sign in to comment.