Skip to content

Commit

Permalink
Fixed return code check for 403 in task
Browse files Browse the repository at this point in the history
  • Loading branch information
Dympna Laverty committed Nov 7, 2023
1 parent 5bf84d3 commit a647a65
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions plugins/duo_admin/komand_duo_admin/util/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ def make_request(self, method: str, path: str, params: dict = {}) -> requests.Re
headers=self.get_headers(method=method.upper(), host=self.hostname, path=path, params=params),
)

#TODO Update to 403
if response.status_code == 403 and path in TASK_PATHS_ALLOW_403:
# Special case: A task user who only has permissions for certain endpoints should not error out.
# Log and return an empty response instead
Expand All @@ -175,7 +174,7 @@ def make_request(self, method: str, path: str, params: dict = {}) -> requests.Re
except requests.exceptions.HTTPError as error:
raise PluginException(preset=PluginException.Preset.UNKNOWN, data=error)

def _handle_exceptions(self, response, path):
def _handle_exceptions(self, response):
if response.status_code == 400:
raise ApiException(
preset=PluginException.Preset.BAD_REQUEST,
Expand Down

0 comments on commit a647a65

Please sign in to comment.