mirror of
https://github.com/pretix/pretix.git
synced 2026-08-17 11:56:27 +00:00
Orders: Fix N+1 query issues on order detail and change page (#6390)
* rders: Fix N+1 query issues on order detail and change page There is one I couldn't fix: Loading the list of tax rules for every select box on the OrderChange page. Unfortunately, Django has a cache-breaking .all() in ModelChoiceField and that would need nasty patching that didn't feel worth it * Fix isort * Fix N+1 query in gate call * Fix leftovers * Add local cache for objects referenced in log entries * Update src/pretix/control/views/orders.py
This commit is contained in:
@@ -562,9 +562,7 @@ class OrderPositionChangeForm(forms.Form):
|
||||
if instance.addon_to_id:
|
||||
del self.fields['operation_split']
|
||||
|
||||
if not instance.seat and not (
|
||||
instance.item.seat_category_mappings.filter(subevent=instance.subevent).exists()
|
||||
):
|
||||
if not instance.seat and not instance._seat_allowed:
|
||||
del self.fields['seat']
|
||||
|
||||
choices = [
|
||||
|
||||
Reference in New Issue
Block a user