From 372427375dfeb85d1da8d516b721c797750a8269 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 4 Mar 2021 10:38:04 +0100 Subject: [PATCH] correct response for every stamp check --- ereuse_devicehub/resources/documents/documents.py | 8 ++++++-- .../resources/documents/templates/documents/stamp.html | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ereuse_devicehub/resources/documents/documents.py b/ereuse_devicehub/resources/documents/documents.py index 4e8a073b..9d74ca10 100644 --- a/ereuse_devicehub/resources/documents/documents.py +++ b/ereuse_devicehub/resources/documents/documents.py @@ -264,10 +264,14 @@ class StampsView(View): result = ('', '') if 'docUpload' in request.files: file_check = request.files['docUpload'] - result = ('Bad', 'Sorry, this file has not been produced by this website') + bad = 'There are no coincidences. The attached file data does not come \ + from our backend or it has been subsequently modified.' + ok = '100% coincidence. The attached file contains data 100% existing in \ + to our backend' + result = ('Bad', bad) if file_check.mimetype in ['text/csv', 'application/pdf']: if verify_hash(file_check): - result = ('Ok', 'Yes, this file has been produced by this website') + result = ('Ok', ok) return flask.render_template('documents/stamp.html', rq_url=self.get_url_path(), result=result) diff --git a/ereuse_devicehub/resources/documents/templates/documents/stamp.html b/ereuse_devicehub/resources/documents/templates/documents/stamp.html index 0a7bfaf3..0a368f4d 100644 --- a/ereuse_devicehub/resources/documents/templates/documents/stamp.html +++ b/ereuse_devicehub/resources/documents/templates/documents/stamp.html @@ -40,11 +40,11 @@