Skip to content

Commit

Permalink
Add if checks for status code in delete function
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno committed Oct 29, 2023
1 parent 7e88256 commit 8168af3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions classes/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,15 @@ def put_data(self, data):
print(f"Successfully put data to {self.path} 🎉")
else:
print(f"Error putting data to {self.path}: {response.status_code} - {response.text} ❌")
return response

def delete_data(self):
# delete data from path
response = requests.delete(self.path, headers=self.headers)
if response.status_code in self.status_codes:
print(f"Successfully deleted data from {self.path} 🎉")
else:
print(f"Error deleting data from {self.path}: {response.status_code} - {response.text} ❌")
return response

def get_all_data(self, path, params):
Expand Down

0 comments on commit 8168af3

Please sign in to comment.