Fixed 21967: Check for object in get_form_kwargs.

This patch addresses [this issue](https://code.djangoproject.com/ticket/21967)