mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-06 07:47:53 +10:00
refactor: Avoid assigning tags directly when re-creating the snapshot from the json file
This commit is contained in:
@@ -100,6 +100,9 @@ class Snapshot(models.Model):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def from_json(cls, info: dict):
|
def from_json(cls, info: dict):
|
||||||
info = {k: v for k, v in info.items() if k in cls.keys}
|
info = {k: v for k, v in info.items() if k in cls.keys}
|
||||||
|
if "tags" in info:
|
||||||
|
# TODO: Handle tags
|
||||||
|
info.pop("tags")
|
||||||
return cls(**info)
|
return cls(**info)
|
||||||
|
|
||||||
def as_json(self, *args) -> dict:
|
def as_json(self, *args) -> dict:
|
||||||
|
|||||||
Reference in New Issue
Block a user