Fixed invalid type in spool model
This commit is contained in:
@@ -139,7 +139,7 @@ class Spool(BaseModel):
|
||||
def from_db(item: models.Spool) -> "Spool":
|
||||
"""Create a new Pydantic spool object from a database spool object."""
|
||||
filament = Filament.from_db(item.filament)
|
||||
remaining_weight: float | None = None
|
||||
remaining_weight: Optional[float] = None # noqa: FA100
|
||||
if filament.weight is not None:
|
||||
remaining_weight = max(filament.weight - item.used_weight, 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user