patch for Django issue #19773

The original patch was merged into the 1.4 release. We need it for 1.3.2