Add a log entry on manual VAT ID validation (Z#23223874) (#5939)

This commit is contained in:
Raphael Michel
2026-02-27 15:22:50 +01:00
committed by GitHub
parent 005b1d54d3
commit 876ddf1321
2 changed files with 12 additions and 3 deletions

View File

@@ -1641,9 +1641,17 @@ class OrderCheckVATID(OrderView):
try:
normalized_id = validate_vat_id(ia.vat_id, str(ia.country))
ia.vat_id_validated = True
ia.vat_id = normalized_id
ia.save()
with transaction.atomic():
ia.vat_id_validated = True
ia.vat_id = normalized_id
ia.save()
self.order.log_action(
'pretix.event.order.vatid.validated',
data={
'vat_id': normalized_id,
},
user=self.request.user,
)
except VATIDFinalError as e:
messages.error(self.request, e.message)
except VATIDTemporaryError: