molssi-seamm / seamm_dashboard

This is a web dashboard to be used with MolSSI's [Simulation Environment for Atomistic and Molecular Modeling](https://molssi-seamm.github.io) (SEAMM). This dashboard will allow users to view results of their calculations (jobs), keep track of their simulation procedures (flowcharts), and group their jobs into projects.
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

Post method for api/jobs #28

Open janash opened 4 years ago

janash commented 4 years ago

Job must be submitted with title or correct response is not returned from API (job is still added despite response status).

Example:

"path": "/Users/username/seamm/projects/username/Job000053", 
"username": "jessica",
"flowchart": "abcd",
"project": "MyProject",
"title": "None"
}

Returns a json with job id:

{
  "id": 4
}

However without title:

{
"path": "/Users/username/seamm/projects/username/Job000053", 
"username": "jessica",
"flowchart": "abcd",
"project": "MyProject"
}

an error message is returned:

Response code : 500

  File "/Users/jessica/seamm/seamm_dashboard/app/routes/api/jobs.py", line 254, in add_job
    'title': body['title'],
KeyError: 'title'

BUT, the job is still added to the DB.

janash commented 4 years ago

There is a similar problem with project - the API endpoint assumes that project will be in the request body, but it is not a required property by the schema definition.