home · contact · privacy
Default all GET ?sort_by= to "title" also in params-re-writing.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 17 Jun 2024 12:17:19 +0000 (14:17 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 17 Jun 2024 12:17:19 +0000 (14:17 +0200)
plomtask/http.py

index d602f07b9baf3c18df19fa88435928d2a33845d6..55473ea85410f840a6bbfe32e41ba245b1a85202 100644 (file)
@@ -374,6 +374,7 @@ class TaskHandler(BaseHTTPRequestHandler):
             todos.sort(key=lambda t: t.date, reverse=True)
         else:
             todos.sort(key=lambda t: t.date)
+            sort_by = 'title'
         return {'start': start, 'end': end, 'process_id': process_id,
                 'comment_pattern': comment_pattern, 'todos': todos,
                 'all_processes': Process.all(self.conn), 'sort_by': sort_by}
@@ -391,6 +392,7 @@ class TaskHandler(BaseHTTPRequestHandler):
             conditions.sort(key=lambda c: c.title.newest, reverse=True)
         else:
             conditions.sort(key=lambda c: c.title.newest)
+            sort_by = 'title'
         return {'conditions': conditions,
                 'sort_by': sort_by,
                 'pattern': pattern}
@@ -478,6 +480,7 @@ class TaskHandler(BaseHTTPRequestHandler):
             processes.sort(key=lambda p: p.title.newest, reverse=True)
         else:
             processes.sort(key=lambda p: p.title.newest)
+            sort_by = 'title'
         return {'processes': processes, 'sort_by': sort_by, 'pattern': pattern}
 
     # POST handlers