Skip to content

Commit

Permalink
FEATURE: Fallback to system users when creating new TopicEmbed (#12386)
Browse files Browse the repository at this point in the history
Previosly, if the topic embed request had a missing username parameter,
and SiteSetting.embed_by_username was empty we would fail to create the
new topic and not show any errors.

Now we will fallback using the priority:

1. Username parameter
2. SiteSetting.embed_by_username
3. SiteSetting.site_contact_username
4. system user
  • Loading branch information
xfalcox committed Mar 15, 2021
1 parent 0d3b7a3 commit f8d9f09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/topic_retriever.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def perform_retrieve

def fetch_http
if @author_username.nil?
username = SiteSetting.embed_by_username.downcase
username = SiteSetting.embed_by_username.presence || SiteSetting.site_contact_username.presence || Discourse.system_user.username
else
username = @author_username
end
Expand Down

0 comments on commit f8d9f09

Please sign in to comment.