Skip to content

Commit

Permalink
Fix hours used
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdstein committed Jan 31, 2024
1 parent c3651df commit ddb2a15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wintertoo/models/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Program(ProgramCredentials):
startdate: date = Field()
enddate: date = Field()
hours_allocated: float = Field(ge=0.0, default=None)
hours_remaining: float = Field(ge=0.0, default=None)
hours_used: float = Field(ge=0.0, default=0.0)
maxpriority: float = Field(description="Max priority")
progtitle: str = Field(min_length=1, example="A program title", default=None)

Expand All @@ -57,8 +57,8 @@ def validate_time_allocation(self):
"""
total_time = self.hours_allocated
hours_used = self.hours_used
assert not hours_used > total_time
assert not hours_used < 0
assert hours_used <= total_time
assert hours_used >= 0.0
return self

model_config = ConfigDict(extra="forbid")

0 comments on commit ddb2a15

Please sign in to comment.