From 6bad17013d56fc01fd037a8af4611d81009fa79b Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 17 Mar 2022 18:52:58 +0100 Subject: [PATCH] save snapshot --- ereuse_devicehub/inventory/forms.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ereuse_devicehub/inventory/forms.py b/ereuse_devicehub/inventory/forms.py index 5eab3236..81ad9773 100644 --- a/ereuse_devicehub/inventory/forms.py +++ b/ereuse_devicehub/inventory/forms.py @@ -3,6 +3,7 @@ import json from json.decoder import JSONDecodeError from boltons.urlutils import URL +from flask import current_app as app from flask import g, request from flask_wtf import FlaskForm from sqlalchemy import or_ @@ -234,12 +235,9 @@ class UploadSnapshotForm(FlaskForm): def save(self, commit=True): if any([x == 'Error' for x in self.result.values()]): return - # result = [] self.sync = Sync() schema = SnapshotSchema() - # self.tmp_snapshots = app.config['TMP_SNAPSHOTS'] - # TODO @cayop get correct var config - self.tmp_snapshots = '/tmp/' + self.tmp_snapshots = app.config['TMP_SNAPSHOTS'] for filename, snapshot_json in self.snapshots: path_snapshot = save_json(snapshot_json, self.tmp_snapshots, g.user.email) snapshot_json.pop('debug', None)