From 4ebb312e59833721fda647e5c4cb11eee78d7e6b Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 3 Feb 2022 11:27:16 +0100 Subject: [PATCH] first step for datawipe form --- ereuse_devicehub/inventory/forms.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ereuse_devicehub/inventory/forms.py b/ereuse_devicehub/inventory/forms.py index 83efbd89..198d762c 100644 --- a/ereuse_devicehub/inventory/forms.py +++ b/ereuse_devicehub/inventory/forms.py @@ -529,3 +529,22 @@ class AllocateForm(NewActionForm): is_valid = False return is_valid + + +class DataWipeForm(NewActionForm): + url = URL(required= False, ) + success = Boolean(required=False, default=False) + software = StringField() + date = DateField(u'endTime', + required=False, + id_document = StringField(u'documentId', + file_name = StringField(u'filename', + validate=validate.Length(max=100)) + file_hash = StringField(u'hash', + default='', + validate=validate.Length(max=64)) + + def validate(self, extra_validators=None): + is_valid = super().validate(extra_validators) + + return is_valid