Fix in import employes

This commit is contained in:
Mauricio Baeza 2022-06-17 13:30:21 -05:00
parent e08e4e038f
commit aea8aeaecf
2 changed files with 3 additions and 2 deletions

View File

@ -1667,10 +1667,11 @@ def html_to_pdf(data):
def import_employees(rfc):
msg = 'No se pudo cargar el archivo'
name = '{}_employees.ods'.format(rfc.lower())
path = _join(PATH_MEDIA, 'tmp', name)
if not is_file(path):
return ()
return (), msg
msg = 'LibreOffice no se pudo iniciar'
if APP_LIBO:

View File

@ -9021,7 +9021,7 @@ class Empleados(BaseModel):
try:
q = Empleados.delete().where(Empleados.id==id)
return bool(q.execute())
except IntegrityError:
except Exception as e:
return False