잉여개발기 (SPDV) 2 年之前
父節點
當前提交
c218b476fa
共有 2 個文件被更改,包括 2 次插入4 次删除
  1. 1 1
      route/main_func_error_404.py
  2. 1 3
      route/topic.py

+ 1 - 1
route/main_func_error_404.py

@@ -11,4 +11,4 @@ def main_func_error_404(e = ''):
             db_data = curs.fetchall()
             db_data = db_data[0][0] if db_data and db_data[0][0] != '' else 'FrontPage'
             
-            return '<script>window.location.href = "/w/' + url_pas(db_data) + '";</script>'
+            return redirect('/w/' + url_pas(db_data))

+ 1 - 3
route/topic.py

@@ -123,9 +123,7 @@ def topic(topic_num = 0, do_type = '', doc_name = 'Test'):
             name_display = 'display: none;' if topic_num != '0' else ''
 
             shortcut = '<div class="opennamu_thread_shortcut" id="thread_shortcut">'
-            curs.execute(db_change(
-                "select id from topic where code = ? order by id + 0 asc"
-            ), [topic_num])
+            curs.execute(db_change("select id from topic where code = ? order by id + 0 asc"), [topic_num])
             db_data = curs.fetchall()
             for for_a in db_data:
                 shortcut += '<a href="#' + for_a[0] + '">#' + for_a[0] + '</a> '