Commit 190c7dc8 authored by Dylan Griffith's avatar Dylan Griffith

Merge branch 'allow-updating-subscriptions' into 'master'

Remove the restriction of trial_end date

See merge request gitlab-org/gitlab!36878
parents 79efa80d 4269ea6c
......@@ -116,10 +116,8 @@ module EE
namespace = find_namespace!(params[:id])
subscription = namespace.gitlab_subscription
trial_ends_on = params[:trial_ends_on]
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[:trial_starts_on] ||= subscription_params[:start_date] if subscription_params[:trial]
......
......@@ -410,15 +410,6 @@ RSpec.describe API::Namespaces do
expect(gitlab_subscription.reload.trial_ends_on).to eq(date)
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
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