improve error on theme upload, add gif to allowed uploads

This commit is contained in:
Sam 2017-05-17 16:29:09 -04:00
parent 851876acfa
commit 2a5a01af2e
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ class Admin::ThemesController < Admin::AdminController
filename = params[:file]&.original_filename || File.basename(path)
upload = UploadCreator.new(file, filename, for_theme: true).create_for(current_user.id)
if upload.errors.count > 0
render json: upload.errors, status: :unprocessable_entity
render_json_error upload
else
render json: { upload_id: upload.id }, status: :created
end

View File

@ -714,7 +714,7 @@ files:
min: 5
max: 150
theme_authorized_extensions:
default: 'jpg|jpeg|png|woff|woff2|svg|eot|ttf|otf'
default: 'jpg|jpeg|png|woff|woff2|svg|eot|ttf|otf|gif'
type: list
authorized_extensions:
client: true