This commit is contained in:
wuaho 2021-07-28 16:59:58 +08:00
parent 80af4c5a7e
commit a81b749b15
2 changed files with 6 additions and 3 deletions

View File

@ -84,8 +84,11 @@ async def copy(
item['_id'] = get_uid()
for report in item['reports']:
report_id = report['report_id']
new_report = crud.report.get(db, report_id)
new_report['_id'] = get_uid()
new_report = await crud.report.get(db, report_id)
new_report_id = get_uid()
new_report['_id'] = new_report_id
new_report['project_id'] = dest_project_id
report['report_id'] = new_report_id
await crud.report.insert_one(db, new_report)
await crud.dashboard.update_one(db,

View File

@ -2,4 +2,4 @@ import time
def get_uid():
return hex(int(time.time() * 1000 * 10 ** 6))[2:]
return hex(int(time.time() * 10 ** 7))[2:]