mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
rename system_username to site_contact_username , system_user is a special user with -1 id that is only used for certain admin tasks
for example system_user will autoclose stuff if needed, it will delete stubs and be the target for flag pms
This commit is contained in:
@@ -128,12 +128,16 @@ module Discourse
|
||||
end
|
||||
end
|
||||
|
||||
# Either returns the system_username user or the first admin.
|
||||
def self.system_user
|
||||
user = User.where(username_lower: SiteSetting.system_username).first if SiteSetting.system_username.present?
|
||||
# Either returns the site_contact_username user or the first admin.
|
||||
def self.site_contact_user
|
||||
user = User.where(username_lower: SiteSetting.site_contact_username).first if SiteSetting.site_contact_username.present?
|
||||
user ||= User.admins.real.order(:id).first
|
||||
end
|
||||
|
||||
def self.system_user
|
||||
User.where(id: -1).first
|
||||
end
|
||||
|
||||
def self.store
|
||||
if SiteSetting.enable_s3_uploads?
|
||||
@s3_store_loaded ||= require 'file_store/s3_store'
|
||||
|
||||
Reference in New Issue
Block a user