Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearer Error Message when uploading NML for inaccessible Dataset #3390

Merged
merged 2 commits into from
Oct 25, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/AnnotationIOController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class AnnotationIOController @Inject()(nmlWriter: NmlWriter,
_ <- bool2Fox(skeletonTracings.nonEmpty || volumeTracingsWithDataLocations.nonEmpty) ?~> "nml.file.noFile"
_ <- bool2Fox(volumeTracingsWithDataLocations.size <= 1) ?~> "nml.file.multipleVolumes"
dataSetName <- assertAllOnSameDataSet(skeletonTracings, volumeTracingsWithDataLocations.headOption.map(_._1)) ?~> "nml.file.differentDatasets"
dataSet <- dataSetDAO.findOneByNameAndOrganization(dataSetName, request.identity._organization)
dataSet <- dataSetDAO.findOneByNameAndOrganization(dataSetName, request.identity._organization) ?~> "dataSet.noAccess"
tracingStoreClient <- tracingStoreService.clientFor(dataSet)
volumeTracingIdOpt <- Fox.runOptional(volumeTracingsWithDataLocations.headOption){ v =>
for {
Expand Down
2 changes: 1 addition & 1 deletion app/models/annotation/AnnotationService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class AnnotationService @Inject()(annotationInformationProvider: AnnotationInfor
def useAsTemplateAndInsert(annotation: Annotation) = {
for {
dataSetName <- dataSetDAO.getNameById(annotation._dataSet)(GlobalAccessContext) ?~> "dataSet.notFound"
dataSet <- dataSetDAO.findOne(annotation._dataSet) ?~> ("Could not access DataSet " + dataSetName + ". Does your team have access?")
dataSet <- dataSetDAO.findOne(annotation._dataSet) ?~> "dataSet.noAccess"
newTracingId <- tracingFromBase(annotation, dataSet) ?~> "Failed to use annotation base as template."
newAnnotation = annotation.copy(
_id = initializingAnnotationId,
Expand Down
1 change: 1 addition & 0 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ braintracing.exists=Great, you already have an account on braintracing.org. Plea
dataSet=Dataset
dataSet.file=Dataset ZIP File
dataSet.notFound=Dataset {0} doesn’t exist
dataSet.noAccess=Could not access DataSet {0}. Does your team have access?
dataSet.notImported=Dataset {0} is not imported
dataSet.name.invalid=A dataset name can only contain letters, digits and underscores
dataSet.import.impossible.name=Import impossible. Dataset name can only consist of a-Z, 0-9, "-" and "_".
Expand Down