Commit 1355c915 authored by Matija Obreza's avatar Matija Obreza

Genus may not contain "sp.", " " is permitted

parent 816d09f1
......@@ -106,8 +106,8 @@ public class BatchRESTServiceImpl implements BatchRESTService {
current.setSubtaxa(StringUtils.defaultIfBlank(stringIfProvided(accnJson.get(Api1Constants.Accession.SUBTAXA), current.getSubtaxa()), ""));
current.setSubtAuthor(StringUtils.defaultIfBlank(stringIfProvided(accnJson.get(Api1Constants.Accession.SUBTAUTHOR), current.getSubtAuthor()), ""));
if (current.getGenus().contains(" ") || current.getGenus().contains("sp.")) {
throw new RESTApiException("GENUS cannot contain spaces or 'sp.'. Offending genus: " + current.getGenus());
if (current.getGenus().contains("sp.")) {
throw new RESTApiException("GENUS cannot contain 'sp.'. Offending genus: " + current.getGenus());
}
if (LOG.isDebugEnabled()) {
......@@ -829,7 +829,7 @@ public class BatchRESTServiceImpl implements BatchRESTService {
if (jsonNode.isNull()) {
return null;
}
return StringUtils.defaultIfBlank(jsonNode.textValue(), currentValue);
return StringUtils.defaultIfBlank(jsonNode.textValue().trim(), currentValue);
}
return currentValue;
}
......
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