mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 13:09:18 +08:00
FEATURE: Fallback to system users when creating new TopicEmbed (#12386)
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
This commit is contained in:
parent
0d3b7a3a82
commit
f8d9f09370
|
@ -41,7 +41,7 @@ class TopicRetriever
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user