Compare commits

..

1 Commits

Author SHA1 Message Date
c612bf13f5 better errorhandling, slimmed down optimizer 2024-08-05 15:27:25 +02:00

@ -30,7 +30,7 @@ def new_trip(preferences: Preferences, start: tuple[float, float], end: tuple[fl
'''
if preferences is None:
raise HTTPException(status_code=406, detail="Preferences not provided")
if preferences.shopping.score == 0 and preferences.sightseeing.score == 0 and preferences.nature.score == 0:
if preferences.shopping.score == 0 and preferences.culture.score == 0 and preferences.nature.score == 0:
raise HTTPException(status_code=406, detail="All preferences are 0.")
if start is None:
raise HTTPException(status_code=406, detail="Start coordinates not provided")