[1.7.x] Removed code deprecated from Django 1.2

Backport of 2779c299c8 from master.