Skip to content

Commit

Permalink
Merge pull request getredash#436 from EverythingMe/fix_ui
Browse files Browse the repository at this point in the history
Fix: sorting not working for columns with special characters
  • Loading branch information
arikfr committed May 19, 2015
2 parents a1c8ef9 + f45281b commit e6ba624
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion rd_ui/app/scripts/ng_smart_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,10 @@
function sortDataRow(array, column) {
var sortAlgo = (scope.sortAlgorithm && angular.isFunction(scope.sortAlgorithm)) === true ? scope.sortAlgorithm : filter('orderBy');
if (column) {
return arrayUtility.sort(array, sortAlgo, column.sortPredicate, column.reverse);
var predicate = function(o) {
return o[column.sortPredicate];
};
return arrayUtility.sort(array, sortAlgo, predicate, column.reverse);
} else {
return array;
}
Expand Down
2 changes: 1 addition & 1 deletion redash/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def execute_query(self, query, data_source_id, metadata):

logging.debug("Annotation: %s", annotation)

annotated_query = "/* {} */ {}".format(annotation, query)
annotated_query = u"/* {} */ {}".format(annotation, query)
else:
annotated_query = query

Expand Down

0 comments on commit e6ba624

Please sign in to comment.