Skip to content

Commit

Permalink
Merge pull request #25 from hhslepicka/fix/remove-repeated-update
Browse files Browse the repository at this point in the history
FIX: Remove duplicated call to update_from_json from DataPoolEntry.
  • Loading branch information
kayqueGovetri authored Oct 17, 2023
2 parents 92ae0b4 + 30781d0 commit ccd6fc1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion botcity/maestro/datapool/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ def _verify_state(self, state: str):
if self.state is None:
return

if self.state == state:
return

if self.state == StateEnum.PENDING:
states = [StateEnum.PROCESSING]
if state not in [StateEnum.PROCESSING]:
Expand All @@ -132,7 +135,6 @@ def save(self) -> 'DataPoolEntry':
data = self.json_to_update()
with requests.post(url, data=data, headers=self.maestro._headers(), timeout=self.maestro.timeout) as req:
if req.ok:
self.update_from_json(payload=req.content)
return self.update_from_json(req.content)
req.raise_for_status()

Expand Down

0 comments on commit ccd6fc1

Please sign in to comment.