Skip to content

Commit

Permalink
Solve pylint warning about not-an-iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
augusto-herrmann committed Feb 12, 2025
1 parent 82a8f5c commit cece68f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ class PlanoEntregasSchema(BaseModel):
@model_validator(mode="after")
def validate_entregas_uniqueness(self) -> "PlanoEntregasSchema":
"""Valida a unicidade das entregas."""
entregas_ids = [entrega.id_entrega for entrega in (self.entregas or [])]
# pylint: disable=not-an-iterable
entregas_ids = [entrega.id_entrega for entrega in self.entregas]
if len(entregas_ids) != len(set(entregas_ids)):
raise ValueError("Entregas devem possuir id_entrega diferentes")
return self
Expand Down

0 comments on commit cece68f

Please sign in to comment.