Skip to content

Commit

Permalink
fix(account): Handle ConfirmEmailView.object = None
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr committed Aug 25, 2023
1 parent b83f925 commit c52304f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions allauth/account/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

2 comments on commit c52304f

@GuterMensch
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@hleroy
Copy link
Contributor

@hleroy hleroy commented on c52304f Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm having 500 errors on ConfirmEmailView since I upgraded to 0.55
NoneType' object has no attribute 'email_address'

Is this related?

Please sign in to comment.