11# -*- coding: utf-8 -*-
2- """
3- TencentBlueKing is pleased to support the open source community by making
4- 蓝鲸智云 - PaaS 平台 (BlueKing - PaaS System) available.
5- Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
6- Licensed under the MIT License (the "License"); you may not use this file except
7- in compliance with the License. You may obtain a copy of the License at
8-
9- http://opensource.org/licenses/MIT
10-
11- Unless required by applicable law or agreed to in writing, software distributed under
12- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13- either express or implied. See the License for the specific language governing permissions and
14- limitations under the License.
15-
16- We undertake not to change the open source license (MIT license) applicable
17- to the current version of the project delivered to anyone in the future.
18- """
2+ # TencentBlueKing is pleased to support the open source community by making
3+ # 蓝鲸智云 - PaaS 平台 (BlueKing - PaaS System) available.
4+ # Copyright (C) Tencent. All rights reserved.
5+ # Licensed under the MIT License (the "License"); you may not use this file except
6+ # in compliance with the License. You may obtain a copy of the License at
7+ #
8+ # http://opensource.org/licenses/MIT
9+ #
10+ # Unless required by applicable law or agreed to in writing, software distributed under
11+ # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
12+ # either express or implied. See the License for the specific language governing permissions and
13+ # limitations under the License.
14+ #
15+ # We undertake not to change the open source license (MIT license) applicable
16+ # to the current version of the project delivered to anyone in the future.
1917
2018import logging
2119import os
@@ -41,15 +39,15 @@ class PatchFeatures:
4139
4240 @cached_property
4341 def minimum_database_version (self ):
44- if self .connection .mysql_is_mariadb : # noqa
42+ if self .connection .mysql_is_mariadb :
4543 return (10 , 4 )
4644 else :
4745 return (5 , 7 )
4846
4947
5048# Django 4.2+ 不再官方支持 Mysql 5.7,但目前 Django 仅是对 5.7 做了软性的不兼容改动,
5149# 在没有使用 8.0 特异的功能时,对 5.7 版本的使用无影响,为兼容存量的 Mysql 5.7 DB 做此 Patch
52- DatabaseFeatures .minimum_database_version = PatchFeatures .minimum_database_version # noqa
50+ DatabaseFeatures .minimum_database_version = PatchFeatures .minimum_database_version
5351
5452pymysql .install_as_MySQLdb ()
5553# Patch version info to force pass Django client check
@@ -205,7 +203,7 @@ def get_logging_config(log_level="DEBUG"):
205203 "disable_existing_loggers" : False ,
206204 "formatters" : {
207205 "verbose" : {
208- "format" : "%(levelname)s [%(asctime)s] %(name)s(ln:%(lineno)d): %(message)s" , # noqa
206+ "format" : "%(levelname)s [%(asctime)s] %(name)s(ln:%(lineno)d): %(message)s" ,
209207 "datefmt" : "%Y-%m-%d %H:%M:%S" ,
210208 },
211209 "simple" : {"format" : "%(levelname)s %(message)s" },
0 commit comments