Applied patch for https://github.com/ckan/ckan/commit/68fe1248370ee1d5bcb2c5d6cb1ec41272d5a747