Fixed location sorting syntax.

Works with mysql, not sure about sqlite (but production uses mysql so I don't know that it matters). 

Production currently throws a 500 if you try and refresh a page after sorting by location on the partner library. This fixes that.