1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2025-03-21 07:39:14 +01:00

Fix privacy policy being empty if custom setting exists but is empty ()

This commit is contained in:
Eugen Rochko 2022-10-08 08:34:00 +02:00 committed by GitHub
parent d4b0aa7450
commit 678fc4d292
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,7 +68,7 @@ class PrivacyPolicy < ActiveModelSerializers::Model
def self.current
custom = Setting.find_by(var: 'site_terms')
if custom
if custom&.value.present?
new(text: custom.value, updated_at: custom.updated_at)
else
new(text: DEFAULT_PRIVACY_POLICY, updated_at: DEFAULT_UPDATED_AT)