chore(api): Introduce Ruff Formatter. (#7291)

This commit is contained in:
-LAN-
2024-08-15 12:54:05 +08:00
committed by GitHub
parent 8f16165f92
commit 3571292fbf
61 changed files with 1315 additions and 1335 deletions

View File

@@ -8,16 +8,16 @@ class HiddenAPIKey(fields.Raw):
api_key = obj.api_key
# If the length of the api_key is less than 8 characters, show the first and last characters
if len(api_key) <= 8:
return api_key[0] + '******' + api_key[-1]
return api_key[0] + "******" + api_key[-1]
# If the api_key is greater than 8 characters, show the first three and the last three characters
else:
return api_key[:3] + '******' + api_key[-3:]
return api_key[:3] + "******" + api_key[-3:]
api_based_extension_fields = {
'id': fields.String,
'name': fields.String,
'api_endpoint': fields.String,
'api_key': HiddenAPIKey,
'created_at': TimestampField
"id": fields.String,
"name": fields.String,
"api_endpoint": fields.String,
"api_key": HiddenAPIKey,
"created_at": TimestampField,
}