Fix critical error in previous commit

This commit is contained in:
Raphael Michel
2019-06-10 17:18:08 +02:00
parent 61e111742d
commit 49c4acefd0
2 changed files with 16 additions and 9 deletions

View File

@@ -244,13 +244,14 @@ class SubEventViewSet(ConditionalListView, viewsets.ModelViewSet):
)
def perform_update(self, serializer):
if serializer.data == self.get_serializer(instance=serializer.instance).data:
original_data = self.get_serializer(instance=serializer.instance).data
super().perform_update(serializer)
if serializer.data == original_data:
# Performance optimization: If nothing was changed, we do not need to save or log anything.
# This costs us a few cycles on save, but avoids thousands of lines in our log.
return
super().perform_update(serializer)
serializer.instance.log_action(
'pretix.subevent.changed',
user=self.request.user,