🐛 封存历史审计与手工改码取件码
This commit is contained in:
1 parent
d75044e884
commit
5db619a1e8
3 files changed
+27
No files matched your search
@@ -856,6 +856,7 @@ async def update_file(
|
||||
if not file_code:
|
||||
raise HTTPException(status_code=404, detail="文件不存在")
|
||||
target_name = file_service._build_file_activity_name(file_code)
|
||||
previous_code = file_code.code
|
||||
update_data = {}
|
||||
|
||||
if data.code is not None and data.code != file_code.code:
|
||||
@@ -879,6 +880,11 @@ async def update_file(
|
||||
update_data["expired_count"] = data.expired_count
|
||||
|
||||
await file_code.update_from_dict(update_data).save()
|
||||
if "code" in update_data:
|
||||
await ShareCodeReservations.get_or_create(
|
||||
code=previous_code,
|
||||
defaults={"file_code_id": file_code.id, "reason": "manual_update"},
|
||||
)
|
||||
if update_data:
|
||||
await file_service.record_admin_activity(
|
||||
action="file.update",
|
||||
|
||||
Reference in new issue
Block a user