Merge branch 'testing' into dpp

This commit is contained in:
Cayo Puigdefabregas 2023-06-14 10:45:42 +02:00
commit 47e918dc07
4 changed files with 34 additions and 2 deletions

View File

@ -7,6 +7,22 @@ ml).
## testing ## 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.
- [fixed] #457 change format erase datawipe.
- [fixed] #458 not datawipe for placeholders computers.
## [2.5.2] - 2023-04-20 ## [2.5.2] - 2023-04-20
- [added] #414 add new vars in the settings file for wb. - [added] #414 add new vars in the settings file for wb.
- [added] #440 add lots in export devices. - [added] #440 add lots in export devices.

View File

@ -1 +1 @@
__version__ = "2.5.2" __version__ = "2.5.3"

View File

@ -29,6 +29,7 @@ from wtforms import (
) )
from wtforms.fields import FormField from wtforms.fields import FormField
from ereuse_devicehub import messages
from ereuse_devicehub.db import db from ereuse_devicehub.db import db
from ereuse_devicehub.inventory.models import ( from ereuse_devicehub.inventory.models import (
DeliveryNote, DeliveryNote,
@ -1093,6 +1094,21 @@ class DataWipeDocumentForm(Form):
class DataWipeForm(ActionFormMixin): class DataWipeForm(ActionFormMixin):
document = FormField(DataWipeDocumentForm) 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): def save(self):
self.document.form.save(commit=False) self.document.form.save(commit=False)

View File

@ -615,7 +615,7 @@ class EraseDataWipe(EraseBasic):
def __format__(self, format_spec: str) -> str: def __format__(self, format_spec: str) -> str:
v = '' v = ''
if 't' in format_spec: 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 's' in format_spec:
if not self.document: if not self.document:
v += 'On {}'.format(self.date_str) v += 'On {}'.format(self.date_str)