Commit 89ccbabb authored by Brian Rosner's avatar Brian Rosner
Browse files

When a form in the admin has no fields prevent failure.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8698 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent b5da9e8b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -23,7 +23,10 @@ class AdminForm(object):
        if self.form._meta.fields is not None:
            name = self.form._meta.fields[0]
            return forms.BoundField(self.form, self.form.fields[name], name)
        try:
            return iter(self.form).next()
        except StopIteration:
            return None

    def _media(self):
        media = self.form.media