Improved storing locale_default at initial setup.

This commit is contained in:
Martin Edenhofer 2017-12-06 16:49:20 +01:00
parent 6c0f7fc1e7
commit 648a4c2522
2 changed files with 9 additions and 9 deletions

View file

@ -240,9 +240,6 @@ class Admin extends App.WizardFullScreen
relogin: (data, status, xhr) => relogin: (data, status, xhr) =>
@log 'notice', 'relogin:success', data @log 'notice', 'relogin:success', data
callback = ->
App.Setting.set('locale_default', App.i18n.detectBrowserLocale())
App.Setting.fetchFull(callback)
App.Event.trigger 'notify:removeall' App.Event.trigger 'notify:removeall'
@navigate 'getting_started/base' @navigate 'getting_started/base'
@ -340,11 +337,9 @@ class Base extends App.WizardFullScreen
@hideAlerts() @hideAlerts()
@disable(e) @disable(e)
# get params
@params = @formParam(e.target) @params = @formParam(e.target)
# add logo
@params.logo = @logoPreview.attr('src') @params.logo = @logoPreview.attr('src')
@params.locale_default = App.i18n.detectBrowserLocale()
store = (logoResizeDataUrl) => store = (logoResizeDataUrl) =>
@params.logo_resize = logoResizeDataUrl @params.logo_resize = logoResizeDataUrl
@ -357,7 +352,7 @@ class Base extends App.WizardFullScreen
success: (data, status, xhr) => success: (data, status, xhr) =>
if data.result is 'ok' if data.result is 'ok'
for key, value of data.settings for key, value of data.settings
App.Config.set( key, value ) App.Config.set(key, value)
if App.Config.get('system_online_service') if App.Config.get('system_online_service')
@navigate 'getting_started/channel/email_pre_configured' @navigate 'getting_started/channel/email_pre_configured'
else else

View file

@ -146,6 +146,11 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
end end
end end
# add locale_default
if params[:locale_default].present?
settings[:locale_default] = params[:locale_default]
end
if messages.present? if messages.present?
render json: { render json: {
result: 'invalid', result: 'invalid',
@ -208,8 +213,8 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
def setup_done_response def setup_done_response
return false if !setup_done return false if !setup_done
groups = Group.where( active: true ) groups = Group.where(active: true)
addresses = EmailAddress.where( active: true ) addresses = EmailAddress.where(active: true)
render json: { render json: {
setup_done: true, setup_done: true,