add cep and cnpj to api
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import json
|
||||
from datetime import datetime, timedelta
|
||||
from typing import NotRequired, TypedDict
|
||||
|
||||
@@ -135,24 +134,22 @@ def _generate_cert(
|
||||
# Send template URI and data to Paperforge API to generate a PDF
|
||||
r = requests.post(
|
||||
PAPERFORGE_API,
|
||||
data=json.dumps(
|
||||
{
|
||||
'template_uri': cert['s3_uri'],
|
||||
'args': {
|
||||
'name': user['name'],
|
||||
'cpf': _cpffmt(user['cpf']),
|
||||
'score': score,
|
||||
'started_at': started_at.strftime('%d/%m/%Y'),
|
||||
'completed_at': completed_at.strftime('%d/%m/%Y'),
|
||||
'today': _datefmt(now_),
|
||||
'year': now_.strftime('%Y'),
|
||||
'expires_at': expires_at.strftime('%d/%m/%Y')
|
||||
if expires_at
|
||||
else None,
|
||||
},
|
||||
json={
|
||||
'template_uri': cert['s3_uri'],
|
||||
'args': {
|
||||
'name': user['name'],
|
||||
'cpf': _cpffmt(user['cpf']),
|
||||
'score': score,
|
||||
'started_at': started_at.strftime('%d/%m/%Y'),
|
||||
'completed_at': completed_at.strftime('%d/%m/%Y'),
|
||||
'today': _datefmt(now_),
|
||||
'year': now_.strftime('%Y'),
|
||||
'expires_at': expires_at.strftime('%d/%m/%Y')
|
||||
if expires_at
|
||||
else None,
|
||||
},
|
||||
),
|
||||
timeout=6,
|
||||
},
|
||||
timeout=(1, 3),
|
||||
)
|
||||
r.raise_for_status()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user