Open
Description
Here you can see a call to get_permissions_groups() makes a subsequent call internal to the module that passes group_name and keyword args to PermissionsGroup.init() in a manner incompatible with the declaration:
File "/Users/eric.brunson/myproject/dyn.py", line 26, in get_data
for group in get_permissions_groups():
File "/Users/eric.brunson/src/github.com/dyn-python/dyn/tm/accounts.py", line 95, in get_permissions_groups
groups.append(PermissionsGroup(None, api=False, **group))
TypeError: __init__() got multiple values for argument 'group_name'
This patch works around it. I initially changed to call signature, but that could break 3rd party code so went with this:
$ git diff
diff --git a/dyn/tm/accounts.py b/dyn/tm/accounts.py
index 64b1772..9c5ab0f 100644
--- a/dyn/tm/accounts.py
+++ b/dyn/tm/accounts.py
@@ -92,7 +92,12 @@ def get_permissions_groups(search=None):
response = DynectSession.get_session().execute(uri, 'GET', api_args)
groups = []
for group in response['data']:
- groups.append(PermissionsGroup(None, api=False, **group))
+ if 'group_name' in group:
+ group_name = group.pop('group_name')
+ else:
+ group_name = None
+ groups.append(PermissionsGroup(group_name, api=False, **group))
if search is not None:
original = groups
groups = []
Metadata
Metadata
Assignees
Labels
No labels