mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 21:11:10 +08:00
Version checks include the branch
This commit is contained in:
@ -201,6 +201,16 @@ module Discourse
|
||||
end
|
||||
end
|
||||
|
||||
def self.git_branch
|
||||
return $git_branch if $git_branch
|
||||
|
||||
begin
|
||||
$git_branch ||= `git rev-parse --abbrev-ref HEAD`.strip
|
||||
rescue
|
||||
$git_branch = "unknown"
|
||||
end
|
||||
end
|
||||
|
||||
# Either returns the site_contact_username user or the first admin.
|
||||
def self.site_contact_user
|
||||
user = User.find_by(username_lower: SiteSetting.site_contact_username.downcase) if SiteSetting.site_contact_username.present?
|
||||
|
Reference in New Issue
Block a user