fix(typing): resolucion integral de advertencias de tipado, extraccion de payload con get_request_payload y limpieza de modelos
This commit is contained in:
@@ -58,7 +58,7 @@ class MilestoneGrade(db.Model):
|
||||
"""Determina si la nota está aprobada (>= 4.00 y no ausente)."""
|
||||
if self.is_absent or self.score is None:
|
||||
return False
|
||||
return self.score >= 4.0
|
||||
return bool(float(self.score) >= 4.0)
|
||||
|
||||
@property
|
||||
def display_score(self) -> str:
|
||||
@@ -66,7 +66,8 @@ class MilestoneGrade(db.Model):
|
||||
if self.is_absent:
|
||||
return 'Ausente'
|
||||
if self.score is not None:
|
||||
return f'{self.score:.1f}' if self.score % 1 != 0 else f'{int(self.score)}'
|
||||
val = float(self.score)
|
||||
return f'{val:.1f}' if val % 1 != 0 else f'{int(val)}'
|
||||
return '-'
|
||||
|
||||
def to_dict(self):
|
||||
|
||||
Reference in New Issue
Block a user