Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #8194: `AdminForm.first_field` now correctly returns the first …

…field when using custom field orders.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit fe8e00ae06f618ba001d8b0fea34d7846602bdc6 1 parent 503fda4
Jacob Kaplan-Moss jacobian authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 django/contrib/admin/
6 django/contrib/admin/
@@ -20,8 +20,10 @@ def __iter__(self):
yield Fieldset(self.form, name, **options)
def first_field(self):
- for bf in self.form:
- return bf
+ if self.form._meta.fields is not None:
+ name = self.form._meta.fields[0]
+ return forms.BoundField(self.form, self.form.fields[name], name)
+ return iter(self.form).next()
def _media(self):
media =
Please sign in to comment.
Something went wrong with that request. Please try again.