mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
Use real images with lazy loading in sas albums and user pictures
This commit is contained in:
@ -39,6 +39,8 @@ class PictureSchema(ModelSchema):
|
||||
compressed_url: str
|
||||
thumb_url: str
|
||||
album: str
|
||||
report_url: str
|
||||
edit_url: str
|
||||
|
||||
@staticmethod
|
||||
def resolve_sas_url(obj: Picture) -> str:
|
||||
@ -56,6 +58,14 @@ class PictureSchema(ModelSchema):
|
||||
def resolve_thumb_url(obj: Picture) -> str:
|
||||
return obj.get_download_thumb_url()
|
||||
|
||||
@staticmethod
|
||||
def resolve_report_url(obj: Picture) -> str:
|
||||
return reverse("sas:picture_ask_removal", kwargs={"picture_id": obj.id})
|
||||
|
||||
@staticmethod
|
||||
def resolve_edit_url(obj: Picture) -> str:
|
||||
return reverse("sas:picture_edit", kwargs={"picture_id": obj.id})
|
||||
|
||||
|
||||
class PictureRelationCreationSchema(Schema):
|
||||
picture: NonNegativeInt
|
||||
|
Reference in New Issue
Block a user