From 7bffd461d15a3ff7f171112fd3d94a4d040f6812 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 8 Sep 2021 20:32:55 +0200 Subject: [PATCH] Allow sales channels to opt out of customer accounts --- src/pretix/base/channels.py | 7 +++++++ src/pretix/presale/checkoutflow.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pretix/base/channels.py b/src/pretix/base/channels.py index 1ed613f711..37fcd8a575 100644 --- a/src/pretix/base/channels.py +++ b/src/pretix/base/channels.py @@ -82,6 +82,13 @@ class SalesChannel: """ return False + @property + def customer_accounts_supported(self) -> bool: + """ + If this property is ``True``, checkout will show the customer login step. + """ + return True + def get_all_sales_channels(): global _ALL_CHANNELS diff --git a/src/pretix/presale/checkoutflow.py b/src/pretix/presale/checkoutflow.py index 7228a64950..35800b23b1 100644 --- a/src/pretix/presale/checkoutflow.py +++ b/src/pretix/presale/checkoutflow.py @@ -236,7 +236,7 @@ class CustomerStep(CartMixin, TemplateFlowStep): icon = 'user' def is_applicable(self, request): - return request.organizer.settings.customer_accounts + return request.organizer.settings.customer_accounts and request.sales_channel.customer_accounts_supported @cached_property def login_form(self):