Skip to content

Commit

Permalink
Merge pull request #39 from guivaloz/guivaloz/sin-sexo
Browse files Browse the repository at this point in the history
Permite sin sexo en partes que sean personas morales
  • Loading branch information
guivaloz authored Dec 12, 2024
2 parents 4decc1a + 9427a23 commit 8cfc62c
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 19 deletions.
1 change: 1 addition & 0 deletions carina/core/exh_exhortos_partes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ExhExhortoParte(Base, UniversalMixin):
GENEROS = {
"M": "MASCULINO",
"F": "FEMENINO",
"-": "SIN SEXO",
}

# Nombre de la tabla
Expand Down
1 change: 1 addition & 0 deletions carina/core/exh_exhortos_promociones_promoventes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class ExhExhortoPromocionPromovente(Base, UniversalMixin):
GENEROS = {
"M": "MASCULINO",
"F": "FEMENINO",
"-": "SIN SEXO",
}

TIPOS_PARTES = {
Expand Down
9 changes: 6 additions & 3 deletions carina/v4/exh_exhortos/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ def create_exh_exhorto(database: Session, exh_exhorto_in: ExhExhortoIn) -> ExhEx
# Remitente es EXTERNO
exh_exhorto.remitente = "EXTERNO"

# Estado es PENDIENTE
exh_exhorto.estado = "PENDIENTE"
# Estado es RECIBIDO
exh_exhorto.estado = "RECIBIDO"

# Insertar el exhorto
database.add(exh_exhorto)
Expand All @@ -198,7 +198,10 @@ def create_exh_exhorto(database: Session, exh_exhorto_in: ExhExhortoIn) -> ExhEx
exh_exhorto_parte.nombre = safe_string(parte.nombre, save_enie=True)
exh_exhorto_parte.apellido_paterno = safe_string(parte.apellidoPaterno, save_enie=True)
exh_exhorto_parte.apellido_materno = safe_string(parte.apellidoMaterno, save_enie=True)
exh_exhorto_parte.genero = safe_string(parte.genero)
if parte.genero in ExhExhortoParte.GENEROS:
exh_exhorto_parte.genero = parte.genero
else:
exh_exhorto_parte.genero = "-"
exh_exhorto_parte.es_persona_moral = parte.esPersonaMoral
exh_exhorto_parte.tipo_parte = parte.tipoParte
exh_exhorto_parte.tipo_parte_nombre = safe_string(parte.tipoParteNombre, save_enie=True)
Expand Down
5 changes: 4 additions & 1 deletion carina/v4/exh_exhortos_promociones/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ def create_exh_exhorto_promocion(database: Session, exh_exhorto_promocion_in: Ex
exh_exhorto_promocion_promovente.nombre = safe_string(promovente.nombre, save_enie=True)
exh_exhorto_promocion_promovente.apellido_paterno = safe_string(promovente.apellidoPaterno, save_enie=True)
exh_exhorto_promocion_promovente.apellido_materno = safe_string(promovente.apellidoMaterno, save_enie=True)
exh_exhorto_promocion_promovente.genero = safe_string(promovente.genero)
if promovente.genero in ExhExhortoPromocionPromovente.GENEROS:
exh_exhorto_promocion_promovente.genero = promovente.genero
else:
exh_exhorto_promocion_promovente.genero = "-"
exh_exhorto_promocion_promovente.es_persona_moral = promovente.esPersonaMoral
exh_exhorto_promocion_promovente.tipo_parte = promovente.tipoParte
exh_exhorto_promocion_promovente.tipo_parte_nombre = safe_string(promovente.tipoParteNombre, save_enie=True)
Expand Down
2 changes: 1 addition & 1 deletion lib/pwgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def generar_api_key(id: int, email: str, random_length: int = 24) -> str:
"""Generar API key a partir de un ID, un e-mail y una cadena aleatoria"""
aleatorio = "".join(random.sample(string.ascii_letters + string.digits, k=random_length))
hash_email = Hashids(salt=email, min_length=8).encode(1)
hash_id = Hashids(salt=settings.SALT, min_length=8).encode(id)
hash_id = Hashids(salt=settings.salt, min_length=8).encode(id)
return f"{hash_id}.{hash_email}.{aleatorio}"


Expand Down
4 changes: 2 additions & 2 deletions lib/schemas_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ class OneBaseOut(BaseModel):

success: bool = True
message: str = "Success"
errors: list[str] = []
data: list[T] = []
errors: list[str]
data: list[T]
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ readme = "README.md"
python = "^3.11"
click = "^8.1.7"
cryptography = "^44.0.0"
fastapi = {extras = ["sqlalchemy"], version = "^0.115.4"}
fastapi = {extras = ["sqlalchemy"], version = "^0.115.6"}
fastapi-pagination = "^0.12.26"
google-auth = "^2.32.0"
google-auth = "^2.37.0"
google-cloud = "^0.34.0"
google-cloud-secret-manager = "^2.20.2"
google-cloud-storage = "^2.18.0"
google-cloud-storage = "^2.19.0"
gunicorn = "^23.0.0"
hashids = "^1.3.1"
psycopg2-binary = "^2.9.9"
pydantic = "^2.8.2"
pydantic = "^2.10.3"
pydantic-settings = "^2.4.0"
python-dotenv = "^1.0.1"
python-multipart = "^0.0.19"
Expand Down
16 changes: 8 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
annotated-types==0.7.0 ; python_version >= "3.11" and python_version < "4.0"
anyio==4.6.2.post1 ; python_version >= "3.11" and python_version < "4.0"
anyio==4.7.0 ; python_version >= "3.11" and python_version < "4.0"
cachetools==5.5.0 ; python_version >= "3.11" and python_version < "4.0"
certifi==2024.8.30 ; python_version >= "3.11" and python_version < "4.0"
cffi==1.17.1 ; python_version >= "3.11" and python_version < "4.0" and platform_python_implementation != "PyPy"
Expand All @@ -8,13 +8,13 @@ click==8.1.7 ; python_version >= "3.11" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.11" and python_version < "4.0" and platform_system == "Windows"
cryptography==44.0.0 ; python_version >= "3.11" and python_version < "4.0"
fastapi-pagination==0.12.32 ; python_version >= "3.11" and python_version < "4.0"
fastapi[sqlalchemy]==0.115.5 ; python_version >= "3.11" and python_version < "4.0"
google-api-core==2.23.0 ; python_version >= "3.11" and python_version < "4.0"
google-api-core[grpc]==2.23.0 ; python_version >= "3.11" and python_version < "4.0"
google-auth==2.36.0 ; python_version >= "3.11" and python_version < "4.0"
fastapi[sqlalchemy]==0.115.6 ; python_version >= "3.11" and python_version < "4.0"
google-api-core==2.24.0 ; python_version >= "3.11" and python_version < "4.0"
google-api-core[grpc]==2.24.0 ; python_version >= "3.11" and python_version < "4.0"
google-auth==2.37.0 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-core==2.4.1 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-secret-manager==2.21.1 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-storage==2.18.2 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-storage==2.19.0 ; python_version >= "3.11" and python_version < "4.0"
google-cloud==0.34.0 ; python_version >= "3.11" and python_version < "4.0"
google-crc32c==1.6.0 ; python_version >= "3.11" and python_version < "4.0"
google-resumable-media==2.7.2 ; python_version >= "3.11" and python_version < "4.0"
Expand All @@ -30,14 +30,14 @@ hashids==1.3.1 ; python_version >= "3.11" and python_version < "4.0"
idna==3.10 ; python_version >= "3.11" and python_version < "4.0"
packaging==24.2 ; python_version >= "3.11" and python_version < "4.0"
proto-plus==1.25.0 ; python_version >= "3.11" and python_version < "4.0"
protobuf==5.29.0 ; python_version >= "3.11" and python_version < "4.0"
protobuf==5.29.1 ; python_version >= "3.11" and python_version < "4.0"
psycopg2-binary==2.9.10 ; python_version >= "3.11" and python_version < "4.0"
pyasn1-modules==0.4.1 ; python_version >= "3.11" and python_version < "4.0"
pyasn1==0.6.1 ; python_version >= "3.11" and python_version < "4.0"
pycparser==2.22 ; python_version >= "3.11" and python_version < "4.0" and platform_python_implementation != "PyPy"
pydantic-core==2.27.1 ; python_version >= "3.11" and python_version < "4.0"
pydantic-settings==2.6.1 ; python_version >= "3.11" and python_version < "4.0"
pydantic==2.10.2 ; python_version >= "3.11" and python_version < "4.0"
pydantic==2.10.3 ; python_version >= "3.11" and python_version < "4.0"
python-dotenv==1.0.1 ; python_version >= "3.11" and python_version < "4.0"
python-multipart==0.0.19 ; python_version >= "3.11" and python_version < "4.0"
pytz==2024.2 ; python_version >= "3.11" and python_version < "4.0"
Expand Down

0 comments on commit 8cfc62c

Please sign in to comment.