Skip to content

Commit 0fa1db5

Browse files
committed
Sort by descending date (not ascending).
1 parent b0ab404 commit 0fa1db5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ def get_all_pastes():
124124
'date': str(date)
125125
})
126126

127-
all_pastes.sort(key = lambda paste : paste['date'])
127+
# Sort by descending order on date.
128+
all_pastes.sort(key = lambda paste : paste['date'], reverse = True)
128129

129130
return jsonify({
130131
'results': all_pastes,
@@ -161,4 +162,4 @@ def initialize_tables():
161162
insert_sample_data()
162163

163164
if __name__ == '__main__':
164-
app.run(port=5000)
165+
app.run(port=5000)

0 commit comments

Comments
 (0)