From e50db7844b8661108546387d10d53e3302ff352c Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 6 Sep 2023 09:55:56 +0200 Subject: [PATCH] Log pretix.customer.created when creating account through OIDC --- src/pretix/presale/views/customer.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/pretix/presale/views/customer.py b/src/pretix/presale/views/customer.py index 646ead4f6..e0d36c9c9 100644 --- a/src/pretix/presale/views/customer.py +++ b/src/pretix/presale/views/customer.py @@ -761,6 +761,17 @@ class SSOLoginReturnView(RedirectBackMixin, View): try: customer.save(force_insert=True) customer_created.send(customer.organizer, customer=customer) + customer.log_action('pretix.customer.created', user=self.request.user, data=dict( + identifier=identifier, + external_identifier=profile['uid'], + provider=self.provider.pk, + email=profile['email'], + phone=profile.get('phone') or None, + name_parts=name_parts, + is_active=True, + is_verified=True, + locale=request.LANGUAGE_CODE, + )) except IntegrityError: # This might either be a race condition or the email address is taken # by a different customer account