From 274f984994b54ca177f47e65f4708a5accb7fe2c Mon Sep 17 00:00:00 2001 From: jaschop <1k5o@tuta.io> Date: Fri, 20 Oct 2023 12:27:41 +0200 Subject: [PATCH] minor cleanups removed clutter from models.py (skill_ids only used for seeding) changed default value of update_profile handler (caused a crash during testing) --- ki/handlers/update_profile.py | 10 +++++----- ki/models.py | 7 ------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/ki/handlers/update_profile.py b/ki/handlers/update_profile.py index 567f153..377b4c5 100644 --- a/ki/handlers/update_profile.py +++ b/ki/handlers/update_profile.py @@ -151,11 +151,11 @@ def update_profile(user_id: int): profile.freetext = request.json.get("freetext", "") profile.visible = request.json.get("visible", False) - update_address(profile, request.json.get("address", {})) - update_contacts(profile, request.json.get("contacts", {})) - update_skills(profile, request.json.get("skills", {})) - update_searchtopics(profile, request.json.get("searchtopics")) - update_languages(profile, request.json.get("languages", {})) + update_address(profile, request.json.get("address")) + update_contacts(profile, request.json.get("contacts", [])) + update_skills(profile, request.json.get("skills", [])) + update_searchtopics(profile, request.json.get("searchtopics", [])) + update_languages(profile, request.json.get("languages", [])) db.session.commit() diff --git a/ki/models.py b/ki/models.py index c4bac66..65961a1 100644 --- a/ki/models.py +++ b/ki/models.py @@ -139,13 +139,6 @@ class Address(db.Model): class Skill(db.Model): - skill_id_php = 1 - skill_id_python = 3 - skill_id_sqlalchemy = 7 - skill_id_mysql = 9 - skill_id_postgresql = 10 - skill_id_sqlite = 11 - __tablename__ = "skill" id = Column(Integer, primary_key=True)