mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 21:25:24 +08:00
FIX: user avatar urls need to be absolute in wordpress api
This commit is contained in:
13
app/serializers/user_wordpress_serializer.rb
Normal file
13
app/serializers/user_wordpress_serializer.rb
Normal file
@ -0,0 +1,13 @@
|
||||
class UserWordpressSerializer < BasicUserSerializer
|
||||
|
||||
include UrlHelper
|
||||
|
||||
def avatar_template
|
||||
if Hash === object
|
||||
absolute User.avatar_template(user[:username], user[:uploaded_avatar_id])
|
||||
else
|
||||
absolute object.avatar_template
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user