SIGN IN SIGN UP

fix: populate name in Invite Admin list view (ENT-11811)

Active admins now resolve name via auth_userprofile.name (the canonical
edX full-name field) before falling back to first_name and username, so
the column shows a real name instead of being blank for users whose
auth_user.first_name is empty.

Pending admins previously returned name=None because the model has no
name column. They now resolve via a UserProfile subquery on user_email,
falling back to user_email itself so the column is never blank. This
also fixes the same blank-name issue in the admin CSV download, which
shares this API endpoint.

UserProfile is imported behind try/except since the student app is not
in INSTALLED_APPS for unit tests, matching the existing pattern in
seed_enterprise_devstack_data. The two production-only branches are
marked # pragma: no cover to match the codebase's convention for code
paths that only run when student is installed.

Bumps version to 8.0.9 with a changelog entry.
S
sjasti-sonata-svg committed
3ff6cbf31708836392ce8b9c58d6a686cff0d1b2
Parent: e26c250
Committed by Alex Dusenbery <alex.dusenbery@gmail.com> on 5/7/2026, 2:17:43 PM