fix(grand):fix sum weight
This commit is contained in:
@@ -14,7 +14,8 @@ class GrandProjectRepository(BaseRepository[GrandProjectModel]):
|
|||||||
def check_weight(self,_inp:GrandProjectModel):
|
def check_weight(self,_inp:GrandProjectModel):
|
||||||
sum = 0
|
sum = 0
|
||||||
for project in _inp.assign_project:
|
for project in _inp.assign_project:
|
||||||
sum = project.weight
|
sum += project.weight
|
||||||
|
print(sum)
|
||||||
if sum != 100:
|
if sum != 100:
|
||||||
raise HTTPException(422, 'مجموعه وزن ها باید صد درصد باشد')
|
raise HTTPException(422, 'مجموعه وزن ها باید صد درصد باشد')
|
||||||
async def create(self, create: GrandProjectModel):
|
async def create(self, create: GrandProjectModel):
|
||||||
|
|||||||
Reference in New Issue
Block a user