Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-19 10:33:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-19 10:33:21 +0300
commit36a59d088eca61b834191dacea009677a96c052f (patch)
treee4f33972dab5d8ef79e3944a9f403035fceea43f /app/services/namespaces
parenta1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff)
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'app/services/namespaces')
-rw-r--r--app/services/namespaces/in_product_marketing_email_records.rb26
-rw-r--r--app/services/namespaces/in_product_marketing_emails_service.rb4
-rw-r--r--app/services/namespaces/package_settings/update_service.rb2
3 files changed, 3 insertions, 29 deletions
diff --git a/app/services/namespaces/in_product_marketing_email_records.rb b/app/services/namespaces/in_product_marketing_email_records.rb
deleted file mode 100644
index 1237a05ea13..00000000000
--- a/app/services/namespaces/in_product_marketing_email_records.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-module Namespaces
- class InProductMarketingEmailRecords
- attr_reader :records
-
- def initialize
- @records = []
- end
-
- def save!
- Users::InProductMarketingEmail.bulk_insert!(@records)
- @records = []
- end
-
- def add(user, track, series)
- @records << Users::InProductMarketingEmail.new(
- user: user,
- track: track,
- series: series,
- created_at: Time.zone.now,
- updated_at: Time.zone.now
- )
- end
- end
-end
diff --git a/app/services/namespaces/in_product_marketing_emails_service.rb b/app/services/namespaces/in_product_marketing_emails_service.rb
index e42c3498c21..414f253deb8 100644
--- a/app/services/namespaces/in_product_marketing_emails_service.rb
+++ b/app/services/namespaces/in_product_marketing_emails_service.rb
@@ -61,7 +61,7 @@ module Namespaces
def initialize(track, interval)
@track = track
@interval = interval
- @sent_email_records = InProductMarketingEmailRecords.new
+ @sent_email_records = ::Users::InProductMarketingEmailRecords.new
end
def execute
@@ -86,7 +86,7 @@ module Namespaces
users_for_group(group).each do |user|
if can_perform_action?(user, group)
send_email(user, group)
- sent_email_records.add(user, track, series)
+ sent_email_records.add(user, track: track, series: series)
end
end
diff --git a/app/services/namespaces/package_settings/update_service.rb b/app/services/namespaces/package_settings/update_service.rb
index cbadbe5c907..c0af0900450 100644
--- a/app/services/namespaces/package_settings/update_service.rb
+++ b/app/services/namespaces/package_settings/update_service.rb
@@ -32,7 +32,7 @@ module Namespaces
end
def allowed?
- Ability.allowed?(current_user, :create_package_settings, @container)
+ Ability.allowed?(current_user, :admin_package, @container)
end
def package_settings_params