From c52304f912e69449c9f1c818dad79b766a9f67c3 Mon Sep 17 00:00:00 2001 From: Raymond Penners Date: Fri, 25 Aug 2023 10:56:19 +0200 Subject: [PATCH] fix(account): Handle ConfirmEmailView.object = None --- allauth/account/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/allauth/account/views.py b/allauth/account/views.py index 6f3e7abb8a..f9785395a1 100644 --- a/allauth/account/views.py +++ b/allauth/account/views.py @@ -411,10 +411,12 @@ def get_context_data(self, **kwargs): { "site": site, "confirmation": self.object, - "can_confirm": self.object.email_address.can_set_verified(), - "email": self.object.email_address.email, + "can_confirm": self.object + and self.object.email_address.can_set_verified(), } ) + if self.object: + ctx["email"] = self.object.email_address.email return ctx def get_redirect_url(self):