links parsing with snapshot view

This commit is contained in:
Cayo Puigdefabregas 2022-03-24 13:30:53 +01:00
parent f7b149f926
commit 01ceeb1be1
2 changed files with 5 additions and 4 deletions

View File

@ -24,7 +24,7 @@ class ParseSnapshot:
self.hwinfo = self.parse_hwinfo() self.hwinfo = self.parse_hwinfo()
self.set_basic_datas() self.set_basic_datas()
self.computer = { self.snapshot_json = {
"device": self.device, "device": self.device,
"software": "Workbench", "software": "Workbench",
"components": self.components(), "components": self.components(),

View File

@ -11,6 +11,7 @@ from flask.json import jsonify
from sqlalchemy.util import OrderedSet from sqlalchemy.util import OrderedSet
from ereuse_devicehub.db import db from ereuse_devicehub.db import db
from ereuse_devicehub.parser.parser import ParseSnapshot
from ereuse_devicehub.resources.action.models import RateComputer, Snapshot from ereuse_devicehub.resources.action.models import RateComputer, Snapshot
from ereuse_devicehub.resources.action.rate.v1_0 import CannotRate from ereuse_devicehub.resources.action.rate.v1_0 import CannotRate
from ereuse_devicehub.resources.action.schemas import Snapshot2 from ereuse_devicehub.resources.action.schemas import Snapshot2
@ -161,6 +162,6 @@ class SnapshotView:
self.snapshot_json = self.schema2.load(snapshot_json) self.snapshot_json = self.schema2.load(snapshot_json)
def build2(self): def build2(self):
res = jsonify("Ok") snap = ParseSnapshot(self.snapshot_json)
res.status_code = 201 self.snapshot_json = snap.snapshot_json
return res return self.build()