Specifically warn about some shredders

This commit is contained in:
Raphael Michel
2018-05-10 10:00:52 +02:00
parent 71c8267dea
commit 44a792583c
2 changed files with 21 additions and 1 deletions

View File

@@ -74,6 +74,13 @@ class BaseDataShredder:
""" """
raise NotImplementedError() # NOQA raise NotImplementedError() # NOQA
@property
def tax_relevant(self):
"""
Indicates whether this removes potentially tax-relevant data.
"""
return False
@property @property
def verbose_name(self) -> str: def verbose_name(self) -> str:
""" """
@@ -216,6 +223,7 @@ class AttendeeNameShredder(BaseDataShredder):
class InvoiceAddressShredder(BaseDataShredder): class InvoiceAddressShredder(BaseDataShredder):
verbose_name = _('Invoice addresses') verbose_name = _('Invoice addresses')
identifier = 'invoice_addresses' identifier = 'invoice_addresses'
tax_relevant = True
description = _('This will remove all invoice addresses from orders, as well as logged changes to them.') description = _('This will remove all invoice addresses from orders, as well as logged changes to them.')
def generate_files(self) -> List[Tuple[str, str, str]]: def generate_files(self) -> List[Tuple[str, str, str]]:
@@ -269,6 +277,7 @@ class QuestionAnswerShredder(BaseDataShredder):
class InvoiceShredder(BaseDataShredder): class InvoiceShredder(BaseDataShredder):
verbose_name = _('Invoices') verbose_name = _('Invoices')
identifier = 'invoices' identifier = 'invoices'
tax_relevant = True
description = _('This will remove all invoice PDFs, as well as any of their text content that might contain ' description = _('This will remove all invoice PDFs, as well as any of their text content that might contain '
'personal data from the database. Invoice numbers and totals will be conserved.') 'personal data from the database. Invoice numbers and totals will be conserved.')
@@ -312,6 +321,7 @@ class CachedTicketShredder(BaseDataShredder):
class PaymentInfoShredder(BaseDataShredder): class PaymentInfoShredder(BaseDataShredder):
verbose_name = _('Payment information') verbose_name = _('Payment information')
identifier = 'payment_info' identifier = 'payment_info'
tax_relevant = True
description = _('This will remove payment-related information. Depending on the payment method, all data will be ' description = _('This will remove payment-related information. Depending on the payment method, all data will be '
'removed or personal data only. No download will be offered.') 'removed or personal data only. No download will be offered.')

View File

@@ -25,7 +25,8 @@
<strong> <strong>
{% blocktrans trimmed %} {% blocktrans trimmed %}
It is within your own responsibility to check if you are allowed to delete the affected data in your It is within your own responsibility to check if you are allowed to delete the affected data in your
legislation, e.g. for reasons of taxation. legislation, e.g. for reasons of taxation. In many countries, you need to keep some data in the live
system in case of an audit.
{% endblocktrans %} {% endblocktrans %}
</strong> </strong>
{% blocktrans trimmed %} {% blocktrans trimmed %}
@@ -57,6 +58,15 @@
</label> </label>
<div id="payment_{{ p.provider.identifier }}" class="panel-collapse in"> <div id="payment_{{ p.provider.identifier }}" class="panel-collapse in">
<div class="panel-body"> <div class="panel-body">
{% if shredder.tax_relevant %}
<div class="alert alert-legal">
{% blocktrans trimmed %}
We recommend not to remove this data because you might need it in case
of a tax audit.
{% endblocktrans %}
<div class="clear"></div>
</div>
{% endif %}
{{ shredder.description|safe }} {{ shredder.description|safe }}
</div> </div>
</div> </div>