fix(grand):fix sum weight

This commit is contained in:
shahzeydyfah
2024-03-02 00:26:13 +03:30
parent 6123f5a80d
commit 1ae4f9bfe3
+2 -1
View File
@@ -14,7 +14,8 @@ class GrandProjectRepository(BaseRepository[GrandProjectModel]):
def check_weight(self,_inp:GrandProjectModel):
sum = 0
for project in _inp.assign_project:
sum = project.weight
sum += project.weight
print(sum)
if sum != 100:
raise HTTPException(422, 'مجموعه وزن ها باید صد درصد باشد')
async def create(self, create: GrandProjectModel):