mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Customer accounts: Only link orders by email if wanted
This commit is contained in:
@@ -1747,9 +1747,12 @@ class CustomerDetailView(OrganizerDetailViewMixin, OrganizerPermissionRequiredMi
|
||||
context_object_name = 'orders'
|
||||
|
||||
def get_queryset(self):
|
||||
q = Q(customer=self.customer)
|
||||
if self.request.organizer.settings.customer_accounts_link_by_email:
|
||||
# This is safe because we only let customers with verified emails log in
|
||||
q |= Q(email__iexact=self.customer.email)
|
||||
qs = Order.objects.filter(
|
||||
Q(customer=self.customer)
|
||||
| Q(email__iexact=self.customer.email)
|
||||
q
|
||||
).select_related('event').order_by('-datetime')
|
||||
return qs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user