forked from kompetenzinventar/ki-backend
Rewrite sqlachemy code for 1.4 to 2.x migration
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user