Skip to content
Closed
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
Binary file removed .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ __pycache__/

# C extensions
*.so
# dev
.idea

# Distribution / packaging
.Python
Expand Down
Binary file removed auth0/.DS_Store
Binary file not shown.
Binary file removed auth0/v3/.DS_Store
Binary file not shown.
5 changes: 4 additions & 1 deletion auth0/v3/management/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def delete_all_users(self):
"""
return self.client.delete(self._url())

def get(self, id, fields=[], include_fields=True):
def get(self, id, fields=None, include_fields=True):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'm not a python dev, wanted to understand the potential impact of this?

The default was an empty array, it is now None.
However the first thing you then do is check if fields was None then set it to an empty array. Which was the previous default anyway?

I also noticed other methods use [] for this param and you have not touched those?
https://github.com/Brett55/auth0-python/blob/e300ee2185df0bccd42b77751bda57b90cd7ed3e/auth0/v3/management/users.py#L28

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cocojoe I didn't fix them all, I only fixed the one I saw while using the SDk. This link explains why using a list is bad http://docs.python-guide.org/en/latest/writing/gotchas/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the best practice link. Will review.

Copy link
Contributor

@lbalmaceda lbalmaceda Mar 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only fixed the one I saw while using the SDk

Would be nice if this PR updates every missing lines just like the one @cocojoe linked. Are you willing to update it @Brett55 ?

"""Get a user.

Args:
Expand All @@ -92,6 +92,9 @@ def get(self, id, fields=[], include_fields=True):
include_fields (bool, optional): True if the fields specified are
to be include in the result, False otherwise.
"""
if fields is None:
fields = []

params = {
'fields': ','.join(fields) or None,
'include_fields': str(include_fields).lower()
Expand Down
Binary file removed auth0/v3/test/.DS_Store
Binary file not shown.