workarounds for https://code.djangoproject.com/ticket/19226