Skip to content

Commit

Permalink
Merge branch 'v2.6.x_develop' into fix_fe_test
Browse files Browse the repository at this point in the history
  • Loading branch information
luofann committed Dec 12, 2023
2 parents ec27b68 + 7585af7 commit 49fe6d3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
18 changes: 17 additions & 1 deletion adapter/utils/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"""

from django.core.files.storage import Storage
from django.core.files import File


class CephStorage(Storage):
Expand All @@ -35,8 +36,23 @@ class CephStorage(Storage):
def storage(self):
from bkstorages.backends.rgw import RGWBoto3Storage

class CustomRGWBoto3Storage(RGWBoto3Storage):
def save(self, name, content, max_length=None):
"""
去除validate_file_name(name, allow_relative_path=True) 检查,保证content的可用性
"""
if name is None:
name = content.name

if not hasattr(content, "chunks"):
content = File(content, name)

name = self.get_available_name(name, max_length=max_length)
name = self._save(name, content)
return name

if self._storage is None:
self._storage = RGWBoto3Storage()
self._storage = CustomRGWBoto3Storage()

return self._storage

Expand Down
2 changes: 1 addition & 1 deletion config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def is_owner_or_readonly(article, user):
except Exception:
NEED_PROFILE = False
PROFILE_TEST_PATH = [
{"path": path, "method": ["GET"]}
{"path": path, "method": ["GET", "POST"]}
for path in os.environ.get("BKAPP_PROFILE_TEST_PATH", "").split(",")
if path
]
Expand Down
3 changes: 3 additions & 0 deletions itsm/openapi/management/commands/data/api-definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ stage:
release:
version: {{ settings.STATIC_VERSION }}+{{ settings.DEPLOY_DATETIME }}
comment: "auto release by bk-sops"

grant_permissions:
- bk_app_code: bk-audit
2 changes: 1 addition & 1 deletion itsm/pipeline_plugins/components/collections/bk_sops.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class BkOpsService(ItsmBaseService):
interval = StaticIntervalGenerator(3)

def prepare_task_params(self, state, ticket, sops_info):
values = ticket.get_output_fields(return_format="dict")
values = ticket.get_output_fields(return_format="dict", need_display=True)
if sops_info["bk_biz_id"]["value_type"] == "variable":
bk_biz_id = values.get(sops_info["bk_biz_id"]["value"], 0)
else:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# 请确保指定的包和版本号,可通过pip安装

# blueapps requirement
Django==3.2.4
Django==3.2.13
PyMySQL==0.6.7
mysqlclient==2.0.3
MarkupSafe==1.1.1
Expand Down

0 comments on commit 49fe6d3

Please sign in to comment.