diff --git a/backend/backend.py b/backend/backend.py index 816892b9..799fe552 100644 --- a/backend/backend.py +++ b/backend/backend.py @@ -80,6 +80,10 @@ def main_page(): # Show messages but once. # maybe if the change happened more than a few days ago.. add a class + + # Sort by last_changed + datastore.data['watching'].sort(key=lambda x: x['last_changed'], reverse=True) + output = render_template("watch-overview.html", watches=datastore.data['watching'], messages=messages) messages = [] return output diff --git a/backend/store.py b/backend/store.py index 5865143d..9d0bb4d2 100644 --- a/backend/store.py +++ b/backend/store.py @@ -13,7 +13,6 @@ class ChangeDetectionStore: try: with open('/datastore/url-watches.json') as json_file: self.data = json.load(json_file) - self.data['watching'].reverse() for p in self.data['watching']: print("Watching:", p['url'])