Fixed https://code.djangoproject.com/ticket/22168
Merge https://github.com/fallenflint/django