Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
ykzts marked this conversation as resolved.
Show resolved Hide resolved
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