Ticket #14325: fix_genericforeignkey_comparison.diff

File fix_genericforeignkey_comparison.diff, 725 bytes (added by Martin Natano, 14 years ago)
  • django/contrib/contenttypes/generic.py

    old new  
    4949        # Convenience function using get_model avoids a circular import when
    5050        # using this model
    5151        ContentType = get_model("contenttypes", "contenttype")
    52         if obj:
     52        if obj is not None:
    5353             return ContentType.objects.db_manager(obj._state.db).get_for_model(obj)
    54         elif id:
     54        elif id is not None:
    5555             return ContentType.objects.db_manager(using).get_for_id(id)
    5656        else:
    5757            # This should never happen. I love comments like this, don't you?
Back to Top