fix(ad): 文字广告 cover 列 NOT NULL 冲突;删除 11.txt 杂项
- modules/cms/ad/service.py add_ad/update_ad:非图片广告(type!=1)cover 从 None 改为空字符串 '',避免插入 NOT NULL 列报 'cover cannot be null';详情展示已兼容空串 - 删除 11.txt(既有审查遗留的 bug 清单文件) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -92,12 +92,10 @@ def get_ad_detail(ad_id):
|
||||
# 添加广告
|
||||
|
||||
def add_ad(request, data: AdForm):
|
||||
# 广告封面
|
||||
cover = data.cover
|
||||
# 广告封面(cover 列 NOT NULL,非图片广告用空字符串占位)
|
||||
cover = data.cover or ""
|
||||
if data.type == 1 and cover:
|
||||
cover = save_file(cover, "ad")
|
||||
else:
|
||||
cover = None
|
||||
|
||||
# # 广告标题
|
||||
# title = data.title
|
||||
@@ -124,12 +122,10 @@ def update_ad(request, data: AdForm):
|
||||
if not ad:
|
||||
return R.failed("记录不存在")
|
||||
|
||||
# 广告封面
|
||||
cover = data.cover
|
||||
# 广告封面(cover 列 NOT NULL,非图片广告用空字符串占位)
|
||||
cover = data.cover or ""
|
||||
if data.type == 1 and cover:
|
||||
cover = save_file(cover, "ad")
|
||||
else:
|
||||
cover = None
|
||||
|
||||
# # 广告标题
|
||||
# title = data.title
|
||||
|
||||
Reference in New Issue
Block a user