general fixes

This commit is contained in:
Patrick 2024-10-09 20:20:04 +02:00
parent 281d786c19
commit 885b838704
7 changed files with 66 additions and 23 deletions

View file

@ -108,7 +108,6 @@ class API:
@self.app.route("/interstellar_ai/db", methods=["POST"])
def db_manipulate():
sent_data = request.get_json()
print(sent_data)
action = sent_data.get("action")
if action == "create_account":
return jsonify({"status": 200, "response": self.db.add_user(sent_data)})
@ -161,7 +160,6 @@ class API:
unit_type = sent_data.get("unit_type")
city = sent_data.get("city")
weather_data = self.weather.getweather(unit_type, city)
print(type(weather_data))
return jsonify({"status": 200, "response": weather_data})
self.app.run(debug=True, host="0.0.0.0", port=5000)

View file

@ -67,7 +67,6 @@ class DB:
stored_hashed_password = self.database[username]["hashed_password"]
entered_hashed_password = self.hash_password(password)
print(stored_hashed_password == entered_hashed_password)
return stored_hashed_password == entered_hashed_password
def change_settings(self, data):
@ -127,7 +126,6 @@ class DB:
else:
with open("database.json", "w") as file:
print("saving")
json.dump(self.database, file)
def load_database(self):

View file

@ -18,23 +18,22 @@ class Weather:
data = {
"temperature": weather.temperature,
"humidity": weather.humidity,
"unit": weather.unit,
"unit": str(weather.unit),
"datetime": weather.datetime,
"coordinates": weather.coordinates,
"country": weather.country,
"daily_forecasts": weather.daily_forecasts,
"description": weather.description,
"feels_like": weather.feels_like,
"kind": weather.kind,
"kind": str(weather.kind),
"local_population": weather.local_population,
"locale": weather.locale,
"locale": str(weather.locale),
"location": weather.location,
"precipitation": weather.precipitation,
"pressure": weather.pressure,
"region": weather.region,
"ultraviolet": weather.ultraviolet,
"ultraviolet": str(weather.ultraviolet),
"visibility": weather.visibility,
"wind_direction": weather.wind_direction,
"wind_direction": str(weather.wind_direction),
"wind_speed": weather.wind_speed,
}