From 1bdf0c8baa3d6fcf011f9ed2af376217acedf83c Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 13 Jun 2023 16:48:52 +0200 Subject: [PATCH 1/4] change format erase datawipe --- ereuse_devicehub/resources/action/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ereuse_devicehub/resources/action/models.py b/ereuse_devicehub/resources/action/models.py index fae963ae..dfa87cb5 100644 --- a/ereuse_devicehub/resources/action/models.py +++ b/ereuse_devicehub/resources/action/models.py @@ -568,7 +568,7 @@ class EraseDataWipe(EraseBasic): def __format__(self, format_spec: str) -> str: v = '' if 't' in format_spec: - v += '{} {}.'.format(self.type, self.severity) + v += '{} {}. '.format(self.type, self.severity.get_public_name()) if 's' in format_spec: if not self.document: v += 'On {}'.format(self.date_str) From c27040296d193530b26f2ded95f7a899f0f83804 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 13 Jun 2023 17:14:39 +0200 Subject: [PATCH 2/4] up version --- CHANGELOG.md | 14 ++++++++++++++ ereuse_devicehub/__init__.py | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 771b1d4a..5e37d9b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,20 @@ ml). ## testing +## [2.5.3] - 2023-05-13 +- [added] #450 add new datawipe in csv. +- [changed] #447 Share a lot between 2 users, one is owner the other is read only. +- [changed] #448 enhancements in export lots. +- [changed] #449 remove button of submit in filter of list of devices. +- [changed] #452 New version of settings for workbench. +- [fixed] #445 required File for new documents bat optional for edit document. +- [fixed] #446 Fix id_supplier and id_internal in export devices. +- [fixed] #451 fix new datawipe in certificate erasure. +- [fixed] #453 fix value method in certificate erasure. +- [fixed] #454 remove validation of email for placeholders type mobile. +- [fixed] #455 add placeholders in csv metrics and pdf certificate. +- [fixed] #456 upload placeholders with type datastorage. + ## [2.5.2] - 2023-04-20 - [added] #414 add new vars in the settings file for wb. - [added] #440 add lots in export devices. diff --git a/ereuse_devicehub/__init__.py b/ereuse_devicehub/__init__.py index 667b52f9..43b48b6f 100644 --- a/ereuse_devicehub/__init__.py +++ b/ereuse_devicehub/__init__.py @@ -1 +1 @@ -__version__ = "2.5.2" +__version__ = "2.5.3" From 7638a6dab4d9e164b145293839cb76390800c09a Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 14 Jun 2023 10:17:01 +0200 Subject: [PATCH 3/4] not datawipe for placeholders computers --- ereuse_devicehub/inventory/forms.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ereuse_devicehub/inventory/forms.py b/ereuse_devicehub/inventory/forms.py index 4cab06c5..f9b10aa2 100644 --- a/ereuse_devicehub/inventory/forms.py +++ b/ereuse_devicehub/inventory/forms.py @@ -29,6 +29,7 @@ from wtforms import ( ) from wtforms.fields import FormField +from ereuse_devicehub import messages from ereuse_devicehub.db import db from ereuse_devicehub.inventory.models import ( DeliveryNote, @@ -1092,6 +1093,21 @@ class DataWipeDocumentForm(Form): class DataWipeForm(ActionFormMixin): document = FormField(DataWipeDocumentForm) + def validate(self, extra_validators=None): + is_valid = super().validate(extra_validators) + if not is_valid: + return False + + txt = "Error: Only Data Sanitization actions are " + txt += "allowed on Placeholders that are of the Data Storage type." + for dev in self._devices: + if dev.is_abstract() == 'Placeholder': + if not (isinstance(dev, DataStorage) or isinstance(dev, Mobile)): + messages.error(txt) + return False + + return is_valid + def save(self): self.document.form.save(commit=False) From ffaff20025db029caa3d30da50c8807c78c39104 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 14 Jun 2023 10:43:52 +0200 Subject: [PATCH 4/4] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e37d9b9..f52352dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ ml). - [fixed] #454 remove validation of email for placeholders type mobile. - [fixed] #455 add placeholders in csv metrics and pdf certificate. - [fixed] #456 upload placeholders with type datastorage. +- [fixed] #457 change format erase datawipe. +- [fixed] #458 not datawipe for placeholders computers. ## [2.5.2] - 2023-04-20 - [added] #414 add new vars in the settings file for wb.