Compare commits

..

1 Commits

Author SHA1 Message Date
89511f39cb better errorhandling, slimmed down optimizer
All checks were successful
Build and push docker image / Build (pull_request) Successful in 1m40s
Build and release APK / Build APK (pull_request) Successful in 5m26s
2024-08-05 16:03:29 +02:00

View File

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