diff options
| author | cedricnjanga | 2017-10-23 17:07:14 +0200 | 
|---|---|---|
| committer | cedricnjanga | 2017-10-23 17:07:14 +0200 | 
| commit | 4e3fefe39274424c14c12cd93016fdf495e7cc08 (patch) | |
| tree | 5c9765dcdedfc849c2c6b523768fa99b8a69db73 /app/controllers/api/v1 | |
| parent | 34e17a46d1564aafb05a4fb7e123188df58bc297 (diff) | |
| download | chouette-core-4e3fefe39274424c14c12cd93016fdf495e7cc08.tar.bz2 | |
Refs #4762 Add file extension checking before importing (standard app and api)
Diffstat (limited to 'app/controllers/api/v1')
| -rw-r--r-- | app/controllers/api/v1/imports_controller.rb | 7 | 
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/api/v1/imports_controller.rb b/app/controllers/api/v1/imports_controller.rb index 6050418d8..197e23337 100644 --- a/app/controllers/api/v1/imports_controller.rb +++ b/app/controllers/api/v1/imports_controller.rb @@ -5,7 +5,12 @@ class Api::V1::ImportsController < Api::V1::IbooController    def create      args    = workbench_import_params.merge(creator: 'Webservice')      @import = parent.workbench_imports.create(args) -    create! +    if @import.valid?  +      create! +    else +      binding.pry +      render json: { status: "error", messages: @import.errors.full_messages } +    end    end    private  | 
