Skip to content

[Bug] Submitting a Client Contact without Mandatory Attributes Causes 500 Error #889

@er4z0r

Description

@er4z0r

Description:

While creating a new client, adding a contact without the mandatory title and e-mail fields will trigger an internal server error. The validation logic that prevents the form submission w/o the mandatory fields does not seem to take effect and prevent the submit as it does when adding a new PoC to an existing client.

Are you intending to fix this bug?

"no"

Component(s) Affected:

  • UI

Steps to Reproduce:

  1. Trigger the create client dialoge
  2. Fill in Name and Shortname for the client
  3. Switch to the "Points of Contact" tab
  4. Enter only the Full name
  5. Hit submit

Expected Behavior:

The validation logic kicks in, highlighting the missing mandatory fields (title, e-mail) and preventing the form submission.

Actual Behavior:

A 500 error was returned. I was able to track it down to the following stack-trace:

ERROR 2026-05-13 07:21:38,717 log 37 139912111377200 Internal Server Error: /rolodex/clients/create/
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/asgiref/sync.py", line 557, in thread_handler
    raise exc_info[1]
  File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 42, in inner
    response = await get_response(request)
  File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 253, in _get_response_async
    response = await wrapped_callback(
  File "/usr/local/lib/python3.10/site-packages/asgiref/sync.py", line 506, in __call__
    ret = await asyncio.shield(exec_coro)
  File "/usr/local/lib/python3.10/site-packages/asgiref/current_thread_executor.py", line 40, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/site-packages/asgiref/sync.py", line 561, in thread_handler
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
  File "/app/ghostwriter/api/utils.py", line 410, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
  File "/app/ghostwriter/rolodex/views.py", line 1365, in post
    return self.form_invalid(form)
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/edit.py", line 69, in form_invalid
    return self.render_to_response(self.get_context_data(form=form))
  File "/app/ghostwriter/rolodex/views.py", line 1346, in get_context_data
    ctx = super().get_context_data(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/edit.py", line 75, in get_context_data
    return super().get_context_data(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/detail.py", line 95, in get_context_data
    if self.object:
AttributeError: 'ClientCreate' object has no attribute 'object'

Screenshots/Code Snippets/Sample Files:

You know the Ghost oopsie screen ;-)

Environment Information:

Ghostwriter: 6.3.5 (running in local-prod mode)
OS: Ubuntu 22.04
Browser: Firefox 140.10.2esr
Docker: Docker version 29.4.3, build 055a478
Docker Compose: Docker Compose version v5.1.3

Contributor Checklist:

  • I have searched the issue tracker to ensure this bug hasn't been reported before or is not already being addressed.
  • I have provided clear steps to reproduce the issue.
  • I have included relevant environment information details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions