[Avatar] Fix, sodass korrekte url rausgegeben wird.

This commit is contained in:
Tim Gröger 2020-11-20 20:16:08 +01:00
parent 4b2cb56fbe
commit 1b1dd8d7a7
1 changed files with 2 additions and 2 deletions

View File

@ -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):