forked from enviPath/enviPy
wip
This commit is contained in:
@ -1975,7 +1975,7 @@ def get_package_pathway_node(request, package_uuid, pathway_uuid, node_uuid):
|
||||
|
||||
|
||||
class CreateNode(Schema):
|
||||
nodeAsSmiles: str
|
||||
nodeAsSmiles: str | None = None
|
||||
nodeAsMolFile: str | None = None
|
||||
nodeName: str | None = None
|
||||
nodeReason: str | None = None
|
||||
@ -2007,14 +2007,10 @@ def add_pathway_node(request, package_uuid, pathway_uuid, n: Form[CreateNode]):
|
||||
if "secret" == classification.lower():
|
||||
|
||||
if p.classification_level != Package.Classification.SECRET:
|
||||
return 400, "Cannot create PESs for non-secret packages."
|
||||
return 400, {"message": "Cannot create secret PESs in non-secret packages."}
|
||||
|
||||
data_pools = pes_data.get("dataPools")
|
||||
if data_pools:
|
||||
if s.DATA_POOL_MAPPING[p.data_pool.name] not in data_pools:
|
||||
return 400, {
|
||||
"messsage": f"PES data pool {s.DATA_POOL_MAPPING[p.data_pool.name]} not found in PES data"
|
||||
}
|
||||
if not p.data_pool or not p.data_pool.secret:
|
||||
return 400, {"message": "Cannot create secret PESs in package without a secret data pool."}
|
||||
|
||||
c = PESCompound.create(p, pes_data, n.nodeName, n.nodeReason)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user