Commit c2772f9c authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch '215354-skip-seatlink-for-unlimited-license' into 'master'

Prevent Seat Link Sync when license has no expiration

Closes #215354

See merge request gitlab-org/gitlab!30874
parents 52d0b71d 60a53b07
...@@ -35,6 +35,7 @@ class SyncSeatLinkWorker # rubocop:disable Scalability/IdempotentWorker ...@@ -35,6 +35,7 @@ class SyncSeatLinkWorker # rubocop:disable Scalability/IdempotentWorker
Gitlab::CurrentSettings.seat_link_enabled? && Gitlab::CurrentSettings.seat_link_enabled? &&
License.current && License.current &&
!License.current.trial? && !License.current.trial? &&
License.current.expires_at && # Skip sync if license has no expiration
seat_link_data.date.between?(License.current.starts_at, License.current.expires_at + 14.days) seat_link_data.date.between?(License.current.starts_at, License.current.expires_at + 14.days)
end end
end end
---
title: No seat link sync for licenses without expiration.
merge_request: 30874
author:
type: fixed
...@@ -104,6 +104,14 @@ describe SyncSeatLinkWorker, type: :worker do ...@@ -104,6 +104,14 @@ describe SyncSeatLinkWorker, type: :worker do
include_examples 'no seat link sync' include_examples 'no seat link sync'
end end
context 'when the license has no expiration date' do
before do
create_current_license(expires_at: nil, block_changes_at: nil)
end
include_examples 'no seat link sync'
end
context 'when using an expired license' do context 'when using an expired license' do
before do before do
create_current_license(expires_at: expiration_date) create_current_license(expires_at: expiration_date)
......
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