Browse Source

Fix preferred posting language returning unusable value in REST API (#18428)

closed-social-glitch-2
Eugen Rochko 2 years ago
committed by GitHub
parent
commit
6c699b1723
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions
  1. +2
    -1
      app/models/user.rb
  2. +1
    -1
      app/serializers/rest/preferences_serializer.rb

+ 2
- 1
app/models/user.rb View File

@ -53,6 +53,7 @@ class User < ApplicationRecord
include Settings::Extend
include UserRoles
include Redisable
include LanguagesHelper
# The home and list feeds will be stored in Redis for this amount
# of time, and status fan-out to followers will include only people
@ -248,7 +249,7 @@ class User < ApplicationRecord
end
def preferred_posting_language
settings.default_language || locale
valid_locale_cascade(settings.default_language, locale)
end
def setting_default_privacy

+ 1
- 1
app/serializers/rest/preferences_serializer.rb View File

@ -17,7 +17,7 @@ class REST::PreferencesSerializer < ActiveModel::Serializer
end
def posting_default_language
object.user.setting_default_language.presence
object.user.preferred_posting_language
end
def reading_default_sensitive_media

Loading…
Cancel
Save