Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registrar user may be null, resulting in an exception when attempting to display their email #3232

Open
sentry-io bot opened this issue Nov 29, 2022 · 1 comment
Labels
bug Issue type

Comments

@sentry-io
Copy link

sentry-io bot commented Nov 29, 2022

This occurs after the successful submission of a registrar approval, but then fails on the success message to the user. If it's OK for the registrar user to be null then the message should handle that case.

Sentry Issue: PERMA-2HA

AttributeError: 'NoneType' object has no attribute 'email'
(1 additional frame(s) were not displayed)
...
  File "django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "perma/utils.py", line 96, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "perma/views/user_management.py", line 364, in approve_pending_registrar
    messages.add_message(request, messages.SUCCESS, f'Registrar request for <strong>{target_registrar}</strong> denied. Please inform {target_registrar_user.email} if appropriate.', extra_tags='safe')
@lizadaly lizadaly added the bug Issue type label Nov 29, 2022
@rebeccacremona
Copy link
Contributor

Possibly related #3201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue type
Projects
None yet
Development

No branches or pull requests

2 participants