[Avatar] Fix, sodass korrekte url rausgegeben wird.
This commit is contained in:
parent
4b2cb56fbe
commit
1b1dd8d7a7
|
@ -1,7 +1,7 @@
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from flask import url_for
|
from flask import url_for, request
|
||||||
from sqlalchemy.orm.collections import attribute_mapped_collection
|
from sqlalchemy.orm.collections import attribute_mapped_collection
|
||||||
|
|
||||||
from . import ModelSerializeMixin
|
from . import ModelSerializeMixin
|
||||||
|
@ -68,7 +68,7 @@ class User(db.Model, ModelSerializeMixin):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def avatar_url(self):
|
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
|
@property
|
||||||
def roles(self):
|
def roles(self):
|
||||||
|
|
Loading…
Reference in New Issue