diff --git a/smash/web/api_views/subject.py b/smash/web/api_views/subject.py
index e26ae3526f73fa84fd494e0fc1b2ea1078e4bc76..b96a452f96ee0563361df2eceb761a08bec3ba05 100644
--- a/smash/web/api_views/subject.py
+++ b/smash/web/api_views/subject.py
@@ -95,7 +95,7 @@ def get_subjects_order(subjects_to_be_ordered, order_column, order_direction):
     elif order_column == "visit_8":
         result = order_by_visit(subjects_to_be_ordered, order_direction, 8)
     else:
-        logger.warn("Unknown sort column: " + order_column)
+        logger.warn("Unknown sort column: " + str(order_column))
     return result
 
 
diff --git a/smash/web/tests/api_views/test_subject.py b/smash/web/tests/api_views/test_subject.py
index b1321d56bdd4555ab0420406530dbe5535b21a63..672266db6f3a6f4e0ba6792081b2329d73f332c7 100644
--- a/smash/web/tests/api_views/test_subject.py
+++ b/smash/web/tests/api_views/test_subject.py
@@ -368,7 +368,7 @@ class TestApi(TestCase):
     def test_subjects_filter_visit_1_SHOULD_BE_IN_PROGRESS(self):
         subject = self.study_subject
 
-        visit = create_visit(subject)
+        create_visit(subject)
 
         self.check_subject_filtered([["visit_1", "SHOULD_BE_IN_PROGRESS"]], [subject])
         self.check_subject_filtered([["visit_2", "SHOULD_BE_IN_PROGRESS"]], [])
@@ -421,3 +421,6 @@ class TestApi(TestCase):
         appointment.save()
 
         self.check_subject_ordered("visit_1", [subject, subject2])
+
+    def test_invalid_order(self):
+        self.check_subject_ordered(None, [self.study_subject])