Skip to content

Commit 10618a1

Browse files
authored
Merge pull request #39 from codeuniversity/weather-module-refactor
cache open meteo api data & refactor the code
2 parents 6963091 + a7d982e commit 10618a1

10 files changed

+3063089
-43
lines changed

backend/src/validation/utils.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,3 @@ def validate_timestamp_start_date_before_end_date(startDate, endDate):
2626
raise HTTPException(
2727
status_code=400, detail="endDate must be after startDate")
2828
return endDate
29-
30-
31-
def validate_temperature_timestamp_in_range(start, end):
32-
min_timestamp = -946771200 # 01/01/1940
33-
max_timestamp = int(time.time()) # now
34-
print(end)
35-
print(max_timestamp)
36-
if (start < min_timestamp or end > max_timestamp):
37-
raise HTTPException(
38-
status_code=400, detail=f"Timestamp must be between {min_timestamp} and {max_timestamp}")
39-
elif end <= start:
40-
raise HTTPException(
41-
status_code=400, detail="endDate must be after startDate")
42-
return end

0 commit comments

Comments
 (0)