Fixed #21801 -- Added check for object when calling SingleObjectMixin.get_context_data

When SingleObjectMixin.get_context_data is called, first
check if the view has an actual **object** attribute if not re-call
**self.get_object()**.