Merged in
https://github.com/discourse/discourse/pull/5612
Many thanks to @awole20 for pushing this through.