Archived
修复了无法设置长度的bug
This commit is contained in:
3 files changed
+14
-9
No files matched your search
+5
-1
@@ -7,11 +7,13 @@
|
||||
|
||||
|
||||
import sqlite3
|
||||
from typing import Tuple
|
||||
from flask import render_template
|
||||
from db.sqlite import fetch_style_data
|
||||
from db.sqlite import fetch_table
|
||||
|
||||
|
||||
def view_template(style: str, length: int, name: str, count: str) -> tuple[bool, bool] or tuple[bool, str]:
|
||||
def view_template(style: str, length: int, name: str, count: str) -> str or tuple[bool, bool] or tuple[bool, str]:
|
||||
"""
|
||||
渲染模板
|
||||
:param count:
|
||||
@@ -20,6 +22,8 @@ def view_template(style: str, length: int, name: str, count: str) -> tuple[bool,
|
||||
:param style:
|
||||
:return:
|
||||
"""
|
||||
if style not in fetch_table():
|
||||
return 'BadLength'
|
||||
try:
|
||||
origin_data = fetch_style_data(style) # 获取数据库内的文件
|
||||
except sqlite3.OperationalError:
|
||||
|
||||
Reference in New Issue
Block a user