mirror of
https://github.com/narrrl/holy-flavor-rater.git
synced 2026-11-04 00:47:02 +01:00
refactor
This commit is contained in:
1 parent
5e3474dd59
commit
e4d59a13ba
119 files changed
+15490
-9975
No files matched your search
@@ -0,0 +1,10 @@
|
||||
from typing import Any
|
||||
|
||||
|
||||
def absolute_image_url(serializer: Any, image_field: Any) -> str | None:
|
||||
if not image_field:
|
||||
return None
|
||||
request = serializer.context.get("request")
|
||||
if request:
|
||||
return request.build_absolute_uri(image_field.url)
|
||||
return image_field.url
|
||||
Reference in new issue
Block a user