Skip to content
Snippets Groups Projects
Commit f742140e authored by Maeva Pourpoint's avatar Maeva Pourpoint
Browse files

(Bug fix) Convert "valid" variable to boolean in "compare_sn" function

parent e84173b8
No related branches found
No related tags found
1 merge request!24Functionalities to handle LEMI-424 response
......@@ -83,7 +83,8 @@ def compare_sn(equipment: str, sn: str, data_input: Optional[str] = None) -> boo
"({} != {}). Please correct!".format(equipment, sn, data_input))
else:
valid = re.match(r"^\d{3}$", str(sn)) # type: ignore
if valid is None:
valid = False if valid is None else True
if not valid:
logger.error("The serial number of the {} should be 3 digits "
"long.".format(equipment))
return valid
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment