﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35742	Apply UserAdmin add_form_template according to User model USERNAME_FIELD	antoliny0919		"Hello!! I made a ticket because there was something ambiguous on the Add page of the UserAdmin model.

The UserAdmin model customizes the ModelAdmin Add page with add_form_template variable.
And the template used as the value for that variable is admin/auth/user/add_form.html.

I felt this part was ambiguous in the add_form template.

{{{
...
{% block form_top %}
  {% if not is_popup %}
    <p>{% translate 'First, enter a username and password. Then, you’ll be able to edit more user options.' %}</p>
  {% else %}
    <p>{% translate ""Enter a username and password."" %}</p>
  {% endif %}
{% endblock %}
...
}}}
In the UserAdmin model, when a user uses a custom user model, USERNAME_FIELD allows a field other than username to be used.

However, in the above template, <p>{%translate 'First, enter a username and password. Then, you'll be able to edit more user options.'%}</p> This part is target at the default user provided by Django, so it is awkward because ""username"" is also seen when customizing USERNAME_FIELD using custom users.

Is this part using a static value because it is a ModelAdmin based on the User model provided by Django?

I added the method to the UserAdmin model and modified add_form.html to show the tag using the USERNAME_FIELD value.

I respect the great code from the Django manager and contributors. But I made a ticket out of my personal opinion that the code would be more curious and in a better way.

Thank you for reading it.
"	New feature	new	contrib.admin	5.1	Normal		UserAdmin, add_form_template		Unreviewed	0	0	0	0	0	0
