Rewrite sqlachemy code for 1.4 to 2.x migration

This commit is contained in:
2024-01-11 20:48:13 +01:00
parent ecfa344904
commit 2c781dec6c
4 changed files with 10 additions and 9 deletions

View File

@ -10,13 +10,14 @@ from ki.auth import auth
from ki.handlers import find_profiles as find_profiles_handler
from ki.handlers import update_profile as update_profile_handler
from ki.models import ContactType, Language, Skill, Token, User
from app import app
from app import app, db
content_type_svg = "image/svg+xml"
content_type_png = "image/png"
def token_auth(func):
@wraps(func)
def _token_auth(*args, **kwargs):
auth_header = request.headers.get("Authorization")
@ -65,7 +66,7 @@ def handle_completion_request(model, key):
def handle_icon_request(model, id, path):
object = model.query.get(id)
object = db.session.get(model, id)
if object is None:
return make_response({}, 404)