Skip to content

Bug: User Entries with “None” as Email Display Incorrectly in Admin and Link to Superuser Email #1212

@mariobehling

Description

@mariobehling

In the Eventyay Admin user management page, certain user entries appear with “None” listed as the email address.
When clicking on these entries, the detail view displays the superuser’s email instead of the actual (or missing) user email. This behavior can cause confusion and misidentification of users in the admin panel.

Image

Steps to Reproduce

  1. Log in as an admin and open the Admin → Users section.
  2. Observe some user entries that show None under the email column.
  3. Click one of these users.
  4. The detail view opens and shows the superuser’s email address.

Expected Behavior

  • Users with no email should display a blank or clearly labeled value such as or No email.
  • Clicking on a user with no email should not display or reference the superuser’s email.
  • Each user record should reflect only that user’s stored data.

Observed Behavior

  • Users with missing emails display None in the list.
  • Clicking such users shows the superuser email in the detail view.
  • Potential confusion between missing user data and admin account data.

Possible Cause

  • The admin serializer or model query may fall back to the first available email (possibly the superuser’s) when the field is None.
  • There might be a misconfigured default or reference in the Django admin template or queryset (user.email fallback logic).

Suggested Fix

  • Adjust the admin model or template to handle None values explicitly:

    list_display = ('id', 'name', 'email_display', ...)
    
    def email_display(self, obj):
        return obj.email if obj.email else '—'
  • Ensure that detail views load user-specific data only.

  • Verify that serializers and model admins do not reuse global context variables (like request.user).

Testing Checklist

  • Users without emails display a clear placeholder instead of “None”.
  • Superuser email no longer appears on unrelated user pages.
  • Creating a user without an email does not trigger incorrect associations.
  • Verify on both admin list view and user detail view.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions