This commit is contained in:
Cayo Puigdefabregas 2023-05-30 12:49:37 +02:00
parent a95d643755
commit 35ffb8239f
2 changed files with 21 additions and 5 deletions

View File

@ -563,6 +563,27 @@ class EraseDataWipe(EraseBasic):
def get_public_name(self):
return "EraseDataWipe"
def __format__(self, format_spec: str) -> str:
v = ''
if 't' in format_spec:
v += '{} {}.'.format(self.type, self.severity)
if 's' in format_spec:
if not self.document:
v += 'On {}'.format(self.date_str)
return v
software = self.document.software or ''
url = self.document.url or ''
v += 'Software: {}, {}. '.format(software, url)
v += 'On {}'.format(self.date_str)
return v
@property
def date_str(self):
day = self.created
if self.document:
day = self.document.date or self.end_time or self.created
return '{:%c}'.format(day)
class Step(db.Model):
erasure_id = Column(

View File

@ -378,11 +378,6 @@
</ol>
</dd>
{% endif %}
{% if erasure.type == 'EraseDataWipe' %}
<br />
<dt>Software:</dt>
<dd>{{ erasure.document and erasure.document.software or ''}}</dd>
{% endif %}
{% if erasure.device.proofs %}
<dt>DLT Proofs:</dt>
<dd>