refactor: Avoid assigning tags directly when re-creating the snapshot from the json file
This commit is contained in:
parent
ea84607b47
commit
e95f14d1d0
1 changed files with 3 additions and 0 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue