1
0
Fork 0
mirror of synced 2024-06-24 00:50:23 +12:00

refactor: Avoid assigning tags directly when re-creating the snapshot from the json file

This commit is contained in:
Cristian 2021-01-04 08:33:26 -05:00
parent ea84607b47
commit e95f14d1d0

View file

@ -100,6 +100,9 @@ class Snapshot(models.Model):
@classmethod
def from_json(cls, info: dict):
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)
def as_json(self, *args) -> dict: