Skip to content

Commit 20260df

Browse files
committed
fix: application set language error
1 parent c59a19b commit 20260df

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

apps/application/serializers/application_serializers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ def edit(self, instance: Dict, with_valid=True):
374374
application_access_token.show_source = instance.get('show_source')
375375
if 'language' in instance and instance.get('language') is not None:
376376
application_access_token.language = instance.get('language')
377+
if 'language' not in instance or instance.get('language') is None:
378+
application_access_token.language = None
377379
application_access_token.save()
378380
application_setting_model = DBModelManage.get_model('application_setting')
379381
xpack_cache = DBModelManage.get_model('xpack_cache')

ui/src/views/application-overview/component/DisplaySettingDialog.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const emit = defineEmits(['refresh'])
6060
const displayFormRef = ref()
6161
const form = ref<any>({
6262
show_source: false,
63-
language: '',
63+
language: ''
6464
})
6565
6666
const detail = ref<any>(null)
@@ -72,26 +72,22 @@ watch(dialogVisible, (bool) => {
7272
if (!bool) {
7373
form.value = {
7474
show_source: false,
75-
language: '',
75+
language: ''
7676
}
7777
}
7878
})
7979
const open = (data: any, content: any) => {
8080
detail.value = content
8181
form.value.show_source = data.show_source
82-
form.value.language = data.language || getBrowserLang()
82+
form.value.language = data.language
8383
dialogVisible.value = true
8484
}
8585
8686
const submit = async (formEl: FormInstance | undefined) => {
8787
if (!formEl) return
8888
await formEl.validate((valid, fields) => {
8989
if (valid) {
90-
const obj = {
91-
show_source: form.value.show_source,
92-
language: form.value.language
93-
}
94-
applicationApi.putAccessToken(id as string, obj, loading).then((res) => {
90+
applicationApi.putAccessToken(id as string, form.value, loading).then((res) => {
9591
emit('refresh')
9692
// @ts-ignore
9793
MsgSuccess(t('common.settingSuccess'))

0 commit comments

Comments
 (0)