Better feedback on draft publication
This commit is contained in:
@@ -84,8 +84,8 @@ async def preview_draft(draft_id: str) -> str:
|
||||
return await render_print('localhost', draft)
|
||||
|
||||
|
||||
@print_router.get("/preview/{signature_id}", response_class=HTMLResponse)
|
||||
async def preview_contract(signature_id: str) -> str:
|
||||
@print_router.get("/preview/signature/{signature_id}", response_class=HTMLResponse)
|
||||
async def preview_contract_by_signature(signature_id: str) -> str:
|
||||
contract = await Contract.find_by_signature_id(signature_id)
|
||||
for p in contract.parties:
|
||||
if p.signature_affixed:
|
||||
@@ -94,6 +94,16 @@ async def preview_contract(signature_id: str) -> str:
|
||||
return await render_print('localhost', contract)
|
||||
|
||||
|
||||
@print_router.get("/preview/{contract_id}", response_class=HTMLResponse)
|
||||
async def preview_contract(contract_id: str) -> str:
|
||||
contract = await Contract.get(contract_id)
|
||||
for p in contract.parties:
|
||||
if p.signature_affixed:
|
||||
p.signature_png = retrieve_signature_png(f'media/signatures/{p.signature_uuid}.png')
|
||||
|
||||
return await render_print('localhost', contract)
|
||||
|
||||
|
||||
@print_router.get("/pdf/{contract_id}", response_class=FileResponse)
|
||||
async def create_pdf(contract_id: str) -> str:
|
||||
contract = await Contract.get(contract_id)
|
||||
|
||||
Reference in New Issue
Block a user