Skip to content

Commit

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

def delete_data(self):
# delete data from path
Expand Down

0 comments on commit 7e88256

Please sign in to comment.