Skip to content

Commit

Permalink
Update the product serializer
Browse files Browse the repository at this point in the history
Before LTSS, the product serializer returned true for the free field of
any product

That is no longer true in the Public Cloud scenario, where LTSS is not free

This Fixes that case
  • Loading branch information
jesusbv committed Sep 4, 2024
1 parent 5e9e61f commit c2f30af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/serializers/v3/product_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ def eula_url
end

def free
# Everything is free on RMT :-)
# Everything is free on RMT :-) outside of the Public Cloud (i.e. LTSS)
# Otherwise Yast and SUSEConnect will request a regcode when activating an extension
# FIXME
return object.free if defined?(SccProxy::Engine) && object.extension?

true
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@
context 'when no regcode is provided' do
it 'activates the product' do
data = JSON.parse(response.body)
expect(data['product']['free']).to eq(false)
expect(data['id']).to eq(product.id)
end
end
Expand Down

0 comments on commit c2f30af

Please sign in to comment.