Minor fixes

This commit is contained in:
Aaron Louie 2020-03-18 16:58:50 -04:00
parent 853b2b2502
commit f0678b43d4
3 changed files with 4 additions and 2 deletions

View File

@ -166,7 +166,9 @@ def get_study_workflows(study_id):
# Get study status spec
status_spec: WorkflowSpecModel = session.query(WorkflowSpecModel)\
.filter_by(is_status=True).first()
.filter_by(is_status=True)\
.filter_by(id=study.status_spec_id)\
.first()
status_data = None

View File

@ -19,7 +19,6 @@ def all_specifications():
@auth.login_required
def add_workflow_specification(body):
new_spec: WorkflowSpecModel = WorkflowSpecModelSchema().load(body, session=session)
new_spec.is_status = new_spec.id == 'status'
session.add(new_spec)
session.commit()
return WorkflowSpecModelSchema().dump(new_spec)

View File

@ -5,6 +5,7 @@ from marshmallow_sqlalchemy import SQLAlchemyAutoSchema
from crc import db
class WorkflowSpecCategoryModel(db.Model):
__tablename__ = 'workflow_spec_category'
id = db.Column(db.Integer, primary_key=True)