fix(project):change required field to optional in detail
This commit is contained in:
@@ -82,15 +82,7 @@ class ProjectRepository(BaseRepository[ProjectModel]):
|
||||
update.monitor.code = 'S' + code
|
||||
if update.monitor:
|
||||
update.has_monitor = True
|
||||
if update.monitor.detail and update.monitor.detail.first_amount:
|
||||
price = await use_collection(TaskEnv.CLN_PROJECT_PRICE_REPORT).find_one({'project_id':_id})
|
||||
if not price:
|
||||
price = {
|
||||
'_id': uuid.uuid4(),
|
||||
'project_id': _id,
|
||||
'first_amount': update.monitor.detail.first_amount
|
||||
}
|
||||
await use_collection(TaskEnv.CLN_PROJECT_PRICE_REPORT).insert_one(price)
|
||||
await self.update_report_price(update)
|
||||
|
||||
update.u_at()
|
||||
await use_collection(COLLECTION).update_one({"_id":_id},{"$set":update.mongo_dict()})
|
||||
|
||||
Reference in New Issue
Block a user