Skip to content

Commit

Permalink
Merge pull request #260 from prefeitura-rio/development
Browse files Browse the repository at this point in the history
Versão 2.4
  • Loading branch information
TanookiVerde authored Nov 14, 2024
2 parents b937b8f + 871ff8b commit 6de8060
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Histórico Clínico Integrado (HCI)
# Histórico Clínico Integrado
- Responsável de Infraestrutura: Gabriel Milan (Escritório de Dados)
- Administrador: Pedro Marques (DIT@SMS)

Expand Down
7 changes: 5 additions & 2 deletions app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ async def employee_verify(user: User) -> bool:
f"""SELECT * FROM {BIGQUERY_ERGON_TABLE_ID} WHERE cpf_particao = {user.cpf}""",
from_file="/tmp/credentials.json",
)
if len(ergon_register) == 0:
if len(ergon_register) == 0 or len(ergon_register[0]["dados"]) == 0:
logger.info(f"User {user.username} not found in Ergon")
return False
elif ergon_register[0].get("status_ativo", False) is False:

dado = ergon_register[0]['dados'][0]
if dado["status_ativo"] is False:
return False
else:
return True
Expand Down

0 comments on commit 6de8060

Please sign in to comment.