mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-21 05:41:54 +02: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