Skip to content

Commit 6f9945f

Browse files
committed
fix gist storage
1 parent a6f9490 commit 6f9945f

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

simple_backend/src/task_tracker/storage_gist.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,6 @@ def load(self) -> list[dict]:
3333
except json.JSONDecodeError:
3434
return []
3535
# saving task list on gist
36-
def save(self, tasks: list[dict]) -> None:
37-
body: dict = {
38-
'files': {
39-
self.filename: {
40-
'content': json.dumps({'tasks': tasks})
41-
}
42-
}
43-
}
44-
self._patch(json_data=body)
45-
# loading task list from gist
46-
def load(self) -> list[dict]:
47-
gist_data = self._get()
48-
files = gist_data.get("files", {})
49-
if self.filename not in files:
50-
return []
51-
try:
52-
content = files[self.filename]["content"]
53-
data = json.loads(content)
54-
return data.get("tasks", [])
55-
except json.JSONDecodeError:
56-
return []
57-
# saving task list on gist
5836
def save(self, tasks: list[dict]) -> None:
5937
body: dict = {
6038
'files': {

0 commit comments

Comments
 (0)