Skip to content

Commit

Permalink
Sort uploads by collection id
Browse files Browse the repository at this point in the history
  • Loading branch information
adelavega committed Sep 1, 2021
1 parent 15da294 commit 8511c4f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
12 changes: 3 additions & 9 deletions neuroscout/resources/analysis/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import json
import requests

from ...utils.db import put_record
from ...utils.db import put_record, delete_analysis
from .bib import format_bibliography, find_predictor_citation, _flatten
from ..utils import owner_required, auth_required, fetch_analysis, abort
from ..predictor import get_predictors
Expand Down Expand Up @@ -81,14 +81,8 @@ def put(self, analysis, **kwargs):
def delete(self, analysis):
if analysis.status not in ['DRAFT', 'FAILED'] or analysis.locked:
abort(422, "Analysis not editable, cannot delete.")

analysis.runs = []

# Delete reports
Report.query.filter_by(analysis_id=analysis.hash_id).delete()

db.session.delete(analysis)
db.session.commit()

delete_analysis(analysis)

return {'message': 'deleted!'}, 200

Expand Down
2 changes: 1 addition & 1 deletion neuroscout/resources/analysis/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,4 @@ def post(self, analysis, validation_hash, collection_id=None,
@fetch_analysis
def get(self, analysis):
return NeurovaultCollection.query.filter_by(
analysis_id=analysis.hash_id)
analysis_id=analysis.hash_id).order_by('collection_id')
2 changes: 1 addition & 1 deletion neuroscout/schemas/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PredictorSchema(Schema):
min = fields.Float(description="Minimum value")
mean = fields.Float(description="Mean value")
num_na = fields.Int(description="Numbers of n/as")

dataset_id = fields.Int()

@post_dump
Expand Down

0 comments on commit 8511c4f

Please sign in to comment.