Skip to content

Commit

Permalink
Stopped using json.dumps() for JSON representations
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Campbell committed Jul 27, 2020
1 parent b6ec6b4 commit 7bdaeb1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/ECNQueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def toJson(self) -> dict:
Returns:
dict: JSON safe representation of the item.
"""
return json.dumps(self.jsonData)
return self.jsonData

def __repr__(self) -> str:
return self.queue + str(self.number)
Expand Down Expand Up @@ -308,6 +308,9 @@ def __getItems(self) -> list:
def toJson (self) -> dict:
"""Return JSON safe representation of the Queue
The JSON representation of every item in the Queue is added to the
Queue's JSON data then the Queue's JSON data is returned.
Returns:
dict: JSON safe representation of the Queue
"""
Expand All @@ -316,7 +319,7 @@ def toJson (self) -> dict:
items.append(item.toJson())
self.jsonData["items"] = items

return json.dumps(self.jsonData)
return self.jsonData

def __len__(self) -> int:
return len(self.items)
Expand Down

0 comments on commit 7bdaeb1

Please sign in to comment.