Skip to content

Commit

Permalink
Merge pull request #752 from akrherz/240429-2
Browse files Browse the repository at this point in the history
fix: station is not required for raob service
  • Loading branch information
akrherz authored Apr 29, 2024
2 parents 3ef8235 + 585f066 commit cad8eb2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions htdocs/json/raob.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Schema(CGIModel):

callback: str = Field(None, description="JSONP Callback")
pressure: int = Field(-1, description="Pressure Level of Interest")
station: str = Field(..., description="Station Identifier", max_length=4)
station: str = Field(None, description="Station Identifier", max_length=4)
ts: str = Field(..., description="Timestamp of Interest")


Expand All @@ -57,7 +57,7 @@ def run(ts, sid, pressure):

stationlimiter = ""
params = {"valid": ts}
if sid != "":
if sid is not None:
stationlimiter = " f.station = :sid and "
params["sid"] = sid
if sid.startswith("_"):
Expand Down Expand Up @@ -135,7 +135,7 @@ def parse_time(tstring):
def application(environ, start_response):
"""Answer request."""
sid = environ["station"]
if len(sid) == 3:
if sid is not None and len(sid) == 3:
sid = f"K{sid}"
ts = parse_time(environ["ts"])
pressure = environ["pressure"]
Expand Down

0 comments on commit cad8eb2

Please sign in to comment.