Skip to content

Commit

Permalink
fix an AttributeError
Browse files Browse the repository at this point in the history
'AnonymousUser' object has no attribute 'email'
  • Loading branch information
jennyq committed Apr 29, 2024
1 parent 1232526 commit f596e17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tendenci/apps/events/forms.py
Expand Up @@ -2454,7 +2454,7 @@ def _clean_form(self, form):
if not get_setting('module', 'events', 'canregisteragain'):
# check if this user can register
if not self.user.is_superuser:
if self.user.email.lower() != email.lower():
if self.user.is_authenticated and self.user.email.lower() != email.lower():
raise forms.ValidationError(_(f"{email} is NOT your email address."))

# check if this email address is already used
Expand Down

0 comments on commit f596e17

Please sign in to comment.