File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -693,20 +693,19 @@ def logout():
693693
694694@app .route ("/history/" )
695695def history_redirect ():
696- num = math .ceil ((int (stats ["broadcast" ]["id" ])) / 5 )
697- return redirect (url_for ("history" , page = num ))
696+ return redirect (url_for ("history" , page = 1 ))
698697
699698
700699@app .route ("/history/<int:page>" )
701700def history (page ):
702- query_list = [f"p.id = '{ post_id } '" for post_id in range (( 5 * page ) - 4 , ( 5 * page ) + 1 )]
701+ query_list = [f"p.id = '{ post_id } '" for post_id in range (stats [ "broadcast" ][ "id" ] - 6 , stats [ "broadcast" ][ "id" ] )]
703702 query_str = " OR " .join (query_list )
704703
705704 try :
706705 query_result = post_container .query_items (f"SELECT * FROM Posts p WHERE { query_str } " , enable_cross_partition_query = True )
707706 post_list = stuffimporter .itempaged_to_list (query_result )
708707 except StopIteration :
709- post_list = []
708+ abort ( 404 )
710709
711710 return render_template ("history.html" , post_list = reversed (post_list ), hist_page = int (page ))
712711
You can’t perform that action at this time.
0 commit comments