2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-08-21 19:11:18 +08: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:
Sam 2013-09-06 17:28:37 +10:00
parent 41a1b6942d
commit 2ce4468aa5
27 changed files with 56 additions and 49 deletions

View file

@ -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'