Skip to content

Commit

Permalink
resolve: fixed style and test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Qi-Cui committed Aug 8, 2024
1 parent b46c7f1 commit 80dc5ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/bk-user/bkuser/apis/web/version_log/file_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def _get_change_log_file_name() -> str:
# 如果语言名中含有“-”,则取第一部分与 BkLanguageEnum 比对,例如 en-US 则取 en
lang = translation.get_language()
if "-" in lang:
lang = lang.split("-")[0]
if lang == BkLanguageEnum.EN.value:
lang, _, _ = lang.partition("-")
if lang == BkLanguageEnum.EN:
return FILE_NAME_EN
return FILE_NAME

Expand Down
2 changes: 1 addition & 1 deletion src/bk-user/tests/apis/web/version_log/test_version_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_valid_language_code_en(self, language):
[
("zh"),
("fr"),
("zh-CN"),
("zh-cn"),
],
)
def test_valid_language_code_zh(self, language):
Expand Down

0 comments on commit 80dc5ab

Please sign in to comment.