[1.7.x] Fixed #21801 -- Documented SingleObjectMixin.get_context_data() requires the object attribute.

Backport of 03c1609c47 from master