调整编辑功能
This commit is contained in:
@@ -187,6 +187,21 @@ def update_task(task_id):
|
|||||||
if 'preview_recipients' in data and isinstance(data['preview_recipients'], list):
|
if 'preview_recipients' in data and isinstance(data['preview_recipients'], list):
|
||||||
data['preview_recipients'] = json.dumps(data['preview_recipients'])
|
data['preview_recipients'] = json.dumps(data['preview_recipients'])
|
||||||
|
|
||||||
|
# 转换时间格式
|
||||||
|
if 'created_at' in data:
|
||||||
|
try:
|
||||||
|
date = datetime.strptime(data['created_at'], '%a, %d %b %Y %H:%M:%S GMT')
|
||||||
|
data['created_at'] = date.strftime('%Y-%m-%d %H:%M:%S')
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if 'updated_at' in data:
|
||||||
|
try:
|
||||||
|
date = datetime.strptime(data['updated_at'], '%a, %d %b %Y %H:%M:%S GMT')
|
||||||
|
data['updated_at'] = date.strftime('%Y-%m-%d %H:%M:%S')
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
# 更新任务
|
# 更新任务
|
||||||
db.update_task(task_id, data)
|
db.update_task(task_id, data)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user