Commit fd366a85 authored by Karen Tracey's avatar Karen Tracey
Browse files

Fixed #7582: Removed checks that prevented null=True ForeignKey fields from...

Fixed #7582: Removed checks that prevented null=True ForeignKey fields from being sortable in Admin.  Post queryset-refactor there seems no reason to disallow this.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9080 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 0ededc61
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -115,10 +115,6 @@ def result_headers(cl):

            # So this _is_ a sortable non-field.  Go to the yield
            # after the else clause.
        else:
            if isinstance(f.rel, models.ManyToOneRel) and f.null:
                yield {"text": f.verbose_name}
                continue
        else:
            header = f.verbose_name

+1 −2
Original line number Diff line number Diff line
@@ -162,7 +162,6 @@ class ChangeList(object):
                    except AttributeError:
                        pass
                else:
                    if not isinstance(f.rel, models.ManyToOneRel) or not f.null:
                    order_field = f.name
            except (IndexError, ValueError):
                pass # Invalid ordering specified. Just use the default.