Commit 51e1ee63 authored by Corinna Wiesner's avatar Corinna Wiesner

Use licensee methods

Prior to this change, there were still usages of
licensee[:ATTRIBUTE_NAME] although there were methods introduced to make
the access easier. This change will use those methods in the necessary
places.
parent f379f644
......@@ -360,7 +360,7 @@ class License < ApplicationRecord
end
def data_filename
company_name = self.licensee["Company"] || self.licensee.each_value.first
company_name = self.licensee_company || self.licensee.each_value.first
clean_company_name = company_name.gsub(/[^A-Za-z0-9]/, "")
"#{clean_company_name}.gitlab-license"
end
......
......@@ -34,10 +34,10 @@ module HistoricalUserData
def header_csv
CSV.generate do |csv|
csv << ['License Key', license.data]
csv << ['Email', license.licensee['Email']]
csv << ['Email', license.licensee_email]
csv << ['License Start Date', license.starts_at&.to_s(:csv)]
csv << ['License End Date', license.expires_at&.to_s(:csv)]
csv << ['Company', license.licensee['Company']]
csv << ['Company', license.licensee_company]
csv << ['Generated At', Time.current.to_s(:csv)]
csv << ['']
end
......
......@@ -11,7 +11,7 @@
= render 'admin/licenses/license_status'
%span.gl-ml-5
= _('Licensed to:')
%strong= @license.licensee['Name']
= "(#{@license.licensee['Email']})"
%strong= @license.licensee_name
= "(#{@license.licensee_email})"
%div
= link_to 'View details', admin_license_path, class: "gl-button btn btn-default"
......@@ -21,7 +21,7 @@ class ActiveUserCountThresholdWorker # rubocop:disable Scalability/IdempotentWor
.to_set
# rubocop:enable CodeReuse/ActiveRecord
recipients << license.licensee["Email"] if license.licensee["Email"]
recipients << license.licensee_email if license.licensee_email
LicenseMailer.approaching_active_user_count_limit(recipients.to_a)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment