Skip to content

Commit

Permalink
change the way data are passed to the function
Browse files Browse the repository at this point in the history
  • Loading branch information
mstrlc committed Jun 20, 2023
1 parent 22857ae commit 92586e0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -6971,8 +6971,8 @@ class RHCloud(Entity):

def __init__(self, server_config=None, **kwargs):
self._fields = {
'organization': entity_fields.OneToManyField(Organization),
'location': entity_fields.OneToManyField(Location),
'organization': entity_fields.OneToOneField(Organization),
'location': entity_fields.OneToOneField(Location),
}
super().__init__(server_config, **kwargs)
self._meta = {'api_path': 'api/v2/rh_cloud'}
Expand All @@ -6987,6 +6987,10 @@ def enable_connector(self, synchronous=True, timeout=None, **kwargs):
"""Function to enable RH Cloud connector"""
kwargs = kwargs.copy()
kwargs.update(self._server_config.get_client_kwargs())
kwargs['data'] = {}
if data := _payload(self.get_fields(), self.get_values()):
kwargs['data'] = data
# kwargs['data'].update(_payload(self.get_fields(), self.get_values()))
response = client.post(self.path('enable_connector'), **kwargs)
return _handle_response(response, self._server_config, synchronous, timeout)

Expand Down

0 comments on commit 92586e0

Please sign in to comment.