Fix logging of file upload questions

This commit is contained in:
Raphael Michel
2018-06-25 12:52:44 +02:00
parent 83bc714739
commit a43ee054ad
2 changed files with 14 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ import pytz
import vat_moss.id
from django.conf import settings
from django.contrib import messages
from django.core.files import File
from django.core.urlresolvers import reverse
from django.db.models import Count
from django.http import FileResponse, Http404, HttpResponseNotAllowed
@@ -698,7 +699,12 @@ class OrderModifyInformation(OrderQuestionsViewMixin, OrderView):
self.invoice_form.save()
self.order.log_action('pretix.event.order.modified', {
'invoice_data': self.invoice_form.cleaned_data,
'data': [f.cleaned_data for f in self.forms]
'data': [{
k: (f.cleaned_data.get(k).name
if isinstance(f.cleaned_data.get(k), File)
else f.cleaned_data.get(k))
for k in f.changed_data
} for f in self.forms]
}, user=request.user)
if self.invoice_form.has_changed():
success_message = ('The invoice address has been updated. If you want to generate a new invoice, '

View File

@@ -3,6 +3,7 @@ import os
from decimal import Decimal
from django.contrib import messages
from django.core.files import File
from django.db import transaction
from django.db.models import Sum
from django.http import FileResponse, Http404, JsonResponse
@@ -450,7 +451,12 @@ class OrderModify(EventViewMixin, OrderDetailMixin, OrderQuestionsViewMixin, Tem
self.invoice_form.save()
self.order.log_action('pretix.event.order.modified', {
'invoice_data': self.invoice_form.cleaned_data,
'data': [f.cleaned_data for f in self.forms]
'data': [{
k: (f.cleaned_data.get(k).name
if isinstance(f.cleaned_data.get(k), File)
else f.cleaned_data.get(k))
for k in f.changed_data
} for f in self.forms]
})
if self.invoice_form.has_changed():
success_message = ('Your invoice address has been updated. Please contact us if you need us '