Correcting contract forms display
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
|
||||
import uuid
|
||||
from fastapi import Depends, HTTPException
|
||||
|
||||
from ..core.routes import get_crud_router
|
||||
@@ -48,7 +48,8 @@ async def create(item: ContractCreate, user=Depends(can_create_contract)) -> dic
|
||||
parties.append({
|
||||
'entity': await Entity.get(p.entity_id),
|
||||
'part': p.part,
|
||||
'representative': await Entity.get(p.representative_id) if p.representative_id else None
|
||||
'representative': await Entity.get(p.representative_id) if p.representative_id else None,
|
||||
'signature_uuid': str(uuid.uuid4())
|
||||
})
|
||||
|
||||
contract_dict['parties'] = parties
|
||||
@@ -70,6 +71,11 @@ async def create(item: ContractCreate, user=Depends(can_create_contract)) -> dic
|
||||
return {"message": "Contract Successfully created", "id": o.id}
|
||||
|
||||
|
||||
@contract_router.put("/{id}", response_description="")
|
||||
async def update(id: str, req: ContractUpdate) -> ContractRead:
|
||||
raise HTTPException(status_code=400, detail="No modification on contract")
|
||||
|
||||
|
||||
def replace_variables_in_value(variables, value: str):
|
||||
for v in variables:
|
||||
value = value.replace('%{}%'.format(v.key), v.value)
|
||||
|
||||
Reference in New Issue
Block a user