Skip to content

Commit

Permalink
Revert "Removed Item.toJson b/c Item.json is serializable"
Browse files Browse the repository at this point in the history
This reverts commit 79ac336.
  • Loading branch information
Justin Campbell committed Jul 27, 2020
1 parent 79ac336 commit b6ec6b4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion api/ECNQueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self, queue: str, number: int) -> None:
self.building = self.__getMostRecentHeaderByType("Building")
self.dateReceived = self.__getMostRecentHeaderByType("Date")

self.json = {
self.jsonData = {
"lastUpdated": self.lastUpdated,
"headers": self.headers,
"content": self.content,
Expand Down Expand Up @@ -260,6 +260,14 @@ def __getAssignedTo(self) -> str:
assignedTo = self.__getMostRecentHeaderByType("Assigned-To")
return assignedTo

def toJson(self) -> dict:
"""Returns a JSON safe representation of the item.
Returns:
dict: JSON safe representation of the item.
"""
return json.dumps(self.jsonData)

def __repr__(self) -> str:
return self.queue + str(self.number)

Expand Down

0 comments on commit b6ec6b4

Please sign in to comment.