-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fixed put.group_hunt_group method #80
Conversation
Assigned an empty dict to "serviceInstanceProfile" as this needs to exist for the method to work. Also corrected a couple of things in the docstring.
odins_spear/methods/put.py
Outdated
@@ -897,10 +897,10 @@ def group_hunt_groups_status(self, hunt_group_user_ids: list, status: bool =True | |||
|
|||
|
|||
def group_hunt_group(self, service_provider_id: str, group_id: str, hunt_group_user_id: str, updates: dict): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change hunt_group_user_id to service_user_id in these args.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjust for comments please.
odins_spear/methods/put.py
Outdated
@@ -913,7 +913,8 @@ def group_hunt_group(self, service_provider_id: str, group_id: str, hunt_group_u | |||
|
|||
updates["serviceProviderId"] = service_provider_id | |||
updates["groupId"] = group_id | |||
updates["serviceUserId"] = hunt_group_user_id | |||
updates["serviceUserId"] = hunt_group_user_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should match new argument
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
odins_spear/methods/put.py
Outdated
@@ -913,7 +913,8 @@ def group_hunt_group(self, service_provider_id: str, group_id: str, hunt_group_u | |||
|
|||
updates["serviceProviderId"] = service_provider_id | |||
updates["groupId"] = group_id | |||
updates["serviceUserId"] = hunt_group_user_id | |||
updates["serviceUserId"] = hunt_group_user_id | |||
updates["serviceInstanceProfile"] = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if this is in the updates otherwise here you will override it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
Changed name of argument from 'hunt_group_user_id' to be 'service_user_id'
Updated group_hunt_group method to add a check if "serviceInstanceProfile" is given in the updates dict before overwriting it with an empty dict
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have made the suggested changes.
odins_spear/methods/put.py
Outdated
@@ -897,10 +897,10 @@ def group_hunt_groups_status(self, hunt_group_user_ids: list, status: bool =True | |||
|
|||
|
|||
def group_hunt_group(self, service_provider_id: str, group_id: str, hunt_group_user_id: str, updates: dict): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
odins_spear/methods/put.py
Outdated
@@ -913,7 +913,8 @@ def group_hunt_group(self, service_provider_id: str, group_id: str, hunt_group_u | |||
|
|||
updates["serviceProviderId"] = service_provider_id | |||
updates["groupId"] = group_id | |||
updates["serviceUserId"] = hunt_group_user_id | |||
updates["serviceUserId"] = hunt_group_user_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
odins_spear/methods/put.py
Outdated
@@ -913,7 +913,8 @@ def group_hunt_group(self, service_provider_id: str, group_id: str, hunt_group_u | |||
|
|||
updates["serviceProviderId"] = service_provider_id | |||
updates["groupId"] = group_id | |||
updates["serviceUserId"] = hunt_group_user_id | |||
updates["serviceUserId"] = hunt_group_user_id | |||
updates["serviceInstanceProfile"] = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
Updated if statement to be 'if not...' rather than 'if ... is None'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good, nice work Liv!
odins_spear/methods/put.py
Outdated
@@ -913,19 +913,21 @@ def group_hunt_group(self, service_provider_id: str, group_id: str, hunt_group_u | |||
|
|||
updates["serviceProviderId"] = service_provider_id | |||
updates["groupId"] = group_id | |||
updates["serviceUserId"] = hunt_group_user_id | |||
updates["serviceUserId"] = service_user_id | |||
if updates.get("serviceInstanceProfile") is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you can remove the 'is None' and add 'not'.
Explanation: In Python the If statement can be shortened to look at Boolean states, which it classes None as False. Therefore you can write and if statement like 'if not updates.get("serviceInstanceProfile"):' and this will trigger when that get method evaluates to a Boolean false.
Assigned an empty dict to "serviceInstanceProfile" as this needs to exist for the method to work. Also corrected a couple of things in the docstring.