diff options
-rw-r--r-- | wqflask/wqflask/views.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 1a8536ac..c7582782 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -1434,10 +1434,11 @@ def approve_data(name): dataset_id=name.split(".")[0], # use the dataset name editor=sample_data.get("author"), json_data=json.dumps(sample_data))) - # Once data is approved, rename it! - os.rename(os.path.join("/tmp/sample-data/diffs", name), - os.path.join("/tmp/sample-data/diffs", - f"{name}.approved")) + if modifications: + # Once data is approved, rename it! + os.rename(os.path.join("/tmp/sample-data/diffs", name), + os.path.join("/tmp/sample-data/diffs", + f"{name}.approved")) return redirect("/admin/data-sample/diffs/") |