fix(project):check update

This commit is contained in:
shahzeydyfah
2025-06-26 14:14:03 +03:30
parent 86260c271c
commit 03622c6c38
+1 -1
View File
@@ -104,7 +104,7 @@ class ProjectRepository(BaseRepository[ProjectModel]):
if update.monitor:
update.has_monitor = True
await self.update_report_price(update)
if update.monitor.detail.date_create_project != old_project.monitor.detail.date_create_project or update.monitor.detail.first_time != old_project.monitor.detail.first_time:
if old_project.monitor and old_project.monitor.detail and update.monitor and update.monitor.detail and (update.monitor.detail.date_create_project != old_project.monitor.detail.date_create_project or update.monitor.detail.first_time != old_project.monitor.detail.first_time):
update.date_delay = self.creat_date_delay(update) + datetime.timedelta(days=update.all_delay_day)
update.u_at()
await use_collection(COLLECTION).update_one({"_id": _id}, {"$set": update.mongo_dict()})