Skip to content

Commit

Permalink
Raise ValueError when temp format is nonsense
Browse files Browse the repository at this point in the history
  • Loading branch information
thorrak committed Jul 6, 2023
1 parent 278b7d0 commit 9452a3f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2049,8 +2049,7 @@ def convert_temp(self, desired_temp_format) -> Decimal:
elif self.temp_format == 'C' and desired_temp_format == 'F':
return self.temp_to_f()
else:
logger.error("Invalid temperature format {} specified (current temp format {})".format(desired_temp_format, self.temp_format))
return self.temperature_setting
raise ValueError("Invalid temperature format {} specified (current temp format {})".format(desired_temp_format, self.temp_format))

def ttl_to_string(self, short_code=False):
# This function returns self.ttl in the "5d 3h 4m 15s" format we use to key it in
Expand Down

0 comments on commit 9452a3f

Please sign in to comment.