Skip to content

Commit

Permalink
Merge branch 'main' into testing_logic
Browse files Browse the repository at this point in the history
  • Loading branch information
KaraMelih committed Aug 16, 2024
2 parents 35a5961 + d6421f4 commit d43c0ef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions snews_pt/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ def is_valid(self):

# p_val must be a float between 0 and 1
pv = self.message_data['p_val']
if pv is None:
# it is not a required argument, check only if it is not None
return True
if isinstance(pv, str):
pv = float(pv)
if not (0.0 <= pv <= 1.0):
Expand Down Expand Up @@ -356,6 +359,9 @@ def is_valid(self):

# p_val must be a float between 0 and 1
pv = self.message_data['p_val']
if pv is None:
# it is not a required argument, check only if it is not None
return True
if isinstance(pv, str):
pv = float(pv)
if not (0.0 <= pv <= 1.0):
Expand Down

0 comments on commit d43c0ef

Please sign in to comment.