Page MenuHomePhabricator

Prevent coordinator email server error on some applications
Open, Needs TriagePublic


A server error was prompted on on the step where the coordinator is emailed:

Traceback (most recent call last):
  File "/venv/lib/python3.8/site-packages/django/core/handlers/", line 34, in inner
    response = get_response(request)
  File "/venv/lib/python3.8/site-packages/django/core/handlers/", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/venv/lib/python3.8/site-packages/django/core/handlers/", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/venv/lib/python3.8/site-packages/django/utils/", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/venv/lib/python3.8/site-packages/django/views/decorators/", line 40, in inner
    return func(request, *args, **kwargs)
  File "/venv/lib/python3.8/site-packages/django_comments/views/", line 123, in post_comment
  File "/venv/lib/python3.8/site-packages/django/dispatch/", line 173, in send
    return [
  File "/venv/lib/python3.8/site-packages/django/dispatch/", line 174, in <listcomp>
    (receiver, receiver(signal=self, sender=sender, **named))
  File "/app/TWLight/emails/", line 252, in send_comment_notification_emails,

Exception Type: AttributeError at /comments/post/
Exception Value: 'NoneType' object has no attribute 'email'

The partner is currently marked unavailable, and the coordinator is no longer assigned. It looks like we might not be handling the case where there's simply no recent coordinator to email properly.