From 1b1dd8d7a7f6d8ca823b802740349ed1d387cf9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Fri, 20 Nov 2020 20:16:08 +0100 Subject: [PATCH] [Avatar] Fix, sodass korrekte url rausgegeben wird. --- flaschengeist/models/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flaschengeist/models/user.py b/flaschengeist/models/user.py index 98a2f4a..219900b 100644 --- a/flaschengeist/models/user.py +++ b/flaschengeist/models/user.py @@ -1,7 +1,7 @@ from datetime import date from typing import Optional -from flask import url_for +from flask import url_for, request from sqlalchemy.orm.collections import attribute_mapped_collection from . import ModelSerializeMixin @@ -68,7 +68,7 @@ class User(db.Model, ModelSerializeMixin): @property def avatar_url(self): - return url_for("users.get_avatar", userid=self.userid) + return f'{request.url_root}/{url_for("users.get_avatar", userid=self.userid)}' @property def roles(self):