Commit b1c27d0d authored by Ryan Herbert's avatar Ryan Herbert

helpers fix pipe validation

if pipe was in position 0, it was not detected and an error
parent b5b33978
Pipeline #19951 failed with stages
in 41 seconds
......@@ -29,6 +29,6 @@ class Generic(SampleSet):
error = []
if data["name"] == "":
error.append("name needed")
if data["name"].find("|"):
if data["name"].find("|") >= 0:
error.append("illegal character '|' in name")
return error
......@@ -59,6 +59,6 @@ class Patient(SampleSet):
datetime.datetime.strptime(""+data['birth'], '%Y-%m-%d')
except ValueError:
error.append("date (wrong format)")
if (data["first_name"] + data['last_name']).find('|'):
if (data["first_name"] + data['last_name']).find('|') >= 0:
error.append("illegal character '|' in name")
return error
......@@ -54,7 +54,7 @@ class Run(SampleSet):
datetime.datetime.strptime(""+data['run_date'], '%Y-%m-%d')
except ValueError:
error.append("date (wrong format)")
if data["name"].find("|"):
if data["name"].find("|") >= 0:
error.append("illegal character '|' in name")
return error
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment