Remove old validate cert
This commit is contained in:
parent
d8ecae2c8f
commit
e0d1f40a11
|
@ -1217,43 +1217,6 @@ class Certificado(BaseModel):
|
|||
opt = values['opt']
|
||||
return getattr(cls, f'_{opt}')(values)
|
||||
|
||||
# ~ @classmethod
|
||||
# ~ def get_cert(cls, is_fiel=False):
|
||||
# ~ return Certificado.get(Certificado.es_fiel==is_fiel)
|
||||
|
||||
def get_(cls):
|
||||
return Certificado.select()[0]
|
||||
|
||||
@classmethod
|
||||
def validate(cls, values, session):
|
||||
row = {}
|
||||
result = False
|
||||
|
||||
obj = cls.get_(cls)
|
||||
paths = Configuracion.get_({'fields': 'path_cer'})
|
||||
cert = util.Certificado(paths)
|
||||
auth = Emisor.get_auth()
|
||||
data = cert.validate(values['contra'], session['rfc'], auth)
|
||||
if data:
|
||||
msg = 'Certificado guardado correctamente'
|
||||
q = Certificado.update(**data).where(Certificado.id==obj.id)
|
||||
if q.execute():
|
||||
result = True
|
||||
row = {
|
||||
'cert_rfc': data['rfc'],
|
||||
'cert_serie': data['serie'],
|
||||
'cert_desde': data['desde'],
|
||||
'cert_hasta': data['hasta'],
|
||||
}
|
||||
else:
|
||||
msg = cert.error
|
||||
|
||||
Configuracion.add({'path_key': ''})
|
||||
Configuracion.add({'path_cer': ''})
|
||||
|
||||
return {'ok': result, 'msg': msg, 'data': row}
|
||||
|
||||
|
||||
|
||||
class Folios(BaseModel):
|
||||
serie = TextField(unique=True)
|
||||
|
|
Loading…
Reference in New Issue