Commit 4269ea6c authored by jejacks0n's avatar jejacks0n

Remove the restriction of trial_end date

- This removes the restriction so we can mark expired trials in
customers as expired in gitlab, and be consistent about providing trial
dates, regardless of if it’s in the past or not.
parent 67fdd183
...@@ -116,10 +116,8 @@ module EE ...@@ -116,10 +116,8 @@ module EE
namespace = find_namespace!(params[:id]) namespace = find_namespace!(params[:id])
subscription = namespace.gitlab_subscription subscription = namespace.gitlab_subscription
trial_ends_on = params[:trial_ends_on]
not_found!('GitlabSubscription') unless subscription not_found!('GitlabSubscription') unless subscription
bad_request!("Invalid trial expiration date") if trial_ends_on&.past?
subscription_params = declared_params(include_missing: false) subscription_params = declared_params(include_missing: false)
subscription_params[:trial_starts_on] ||= subscription_params[:start_date] if subscription_params[:trial] subscription_params[:trial_starts_on] ||= subscription_params[:start_date] if subscription_params[:trial]
......
...@@ -410,15 +410,6 @@ RSpec.describe API::Namespaces do ...@@ -410,15 +410,6 @@ RSpec.describe API::Namespaces do
expect(gitlab_subscription.reload.trial_ends_on).to eq(date) expect(gitlab_subscription.reload.trial_ends_on).to eq(date)
end end
end end
context 'when the attr has an old date' do
it 'returns 400' do
do_put(namespace.id, admin, params.merge(trial_ends_on: 2.days.ago.to_date))
expect(response).to have_gitlab_http_status(:bad_request)
expect(gitlab_subscription.reload.trial_ends_on).to be_nil
end
end
end end
end end
end 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