Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes for crd client #128

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion threescale_api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def request(self, method='GET', url=None, path='', params: dict = None,

"""
if 'resource' in kwargs:
del(kwargs['resource'])
del kwargs['resource']
full_url = url if url else urljoin(self.url, path)
full_url = full_url + ".json"
headers = headers or {}
Expand Down
4 changes: 3 additions & 1 deletion threescale_api/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,10 @@ def _lazy_load(self, **kwargs) -> 'DefaultResource':
fetched = self.fetch(**kwargs)
if isinstance(fetched, dict):
self._entity = fetched
else:
elif fetched is not None:
self._entity = fetched._entity
else:
return None
return self

def read(self, **kwargs) -> 'DefaultResource':
Expand Down
2 changes: 1 addition & 1 deletion threescale_api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def url(self) -> str:


class Limits(DefaultClient):
def __init__(self, *args, entity_name='limit', entity_collection='limits', metric,
def __init__(self, *args, entity_name='limit', entity_collection='limits', metric=None,
**kwargs):
super().__init__(*args, entity_name=entity_name,
entity_collection=entity_collection, **kwargs)
Expand Down