mirror of https://github.com/langgenius/dify.git
feat: compatible custom avatar url (#26975)
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
parent
f6ede6f1c1
commit
c91cbf6b97
|
|
@ -81,6 +81,8 @@ class AvatarUrlField(fields.Raw):
|
|||
from models import Account
|
||||
|
||||
if isinstance(obj, Account) and obj.avatar is not None:
|
||||
if obj.avatar.startswith(("http://", "https://")):
|
||||
return obj.avatar
|
||||
return file_helpers.get_signed_file_url(obj.avatar)
|
||||
return None
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue