Skip to content

Commit

Permalink
Fix preferred posting language returning unusable value in REST API
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored and single-right-quote committed May 26, 2022
1 parent dc2247c commit 3199b1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -248,7 +249,7 @@ def disable_two_factor!
end

def preferred_posting_language
settings.default_language || locale
valid_locale_cascade(settings.default_language, locale)
end

def setting_default_privacy
Expand Down
2 changes: 1 addition & 1 deletion app/serializers/rest/preferences_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def posting_default_sensitive
end

def posting_default_language
object.user.setting_default_language.presence
object.user.preferred_posting_language
end

def reading_default_sensitive_media
Expand Down

0 comments on commit 3199b1d

Please sign in to comment.