Skip to content

Commit

Permalink
fix: 取消signal()的providing_args参数传入、force_text修改为force_str TencentBlue…
Browse files Browse the repository at this point in the history
  • Loading branch information
huangpixu committed Dec 9, 2024
1 parent d600dc7 commit 7ccb4e9
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion gcloud/common_template/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
# 项目模板保存后可见的信号,在模板保存事务提交后发出
# template_id: 模板 ID
# is_deleted: 模板是否被删除
post_template_save_commit = Signal(providing_args=["template_id", "is_deleted"])
post_template_save_commit = Signal() # providing_args=["template_id", "is_deleted"]
16 changes: 8 additions & 8 deletions gcloud/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
import uuid

import ujson as json
from django.utils.functional import Promise
from django.utils.encoding import force_text
from django.conf import settings as django_settings
from django.core.serializers.json import DjangoJSONEncoder
from django.utils.encoding import force_str
from django.utils.functional import Promise
from django.utils.timezone import is_aware
from django.conf import settings as django_settings

from gcloud.conf import default_settings

Expand All @@ -34,7 +34,7 @@ def __getattr__(self, key):
if hasattr(default_settings, key):
return getattr(default_settings, key)

raise AttributeError('Settings object has no attribute %s' % key)
raise AttributeError("Settings object has no attribute %s" % key)


settings = GcloudSettings()
Expand All @@ -43,13 +43,13 @@ def __getattr__(self, key):
def default(self, o):
# See "Date Time String Format" in the ECMA-262 specification.
if isinstance(o, Promise):
return force_text(o)
return force_str(o)
elif isinstance(o, datetime.datetime):
r = o.isoformat()
if o.microsecond:
r = r[:23] + r[26:]
if r.endswith('+00:00'):
r = r[:-6] + 'Z'
if r.endswith("+00:00"):
r = r[:-6] + "Z"
return r
elif isinstance(o, datetime.date):
return o.isoformat()
Expand All @@ -63,7 +63,7 @@ def default(self, o):
elif isinstance(o, (decimal.Decimal, uuid.UUID)):
return str(o)
elif isinstance(o, bytes):
return o.decode('utf-8')
return o.decode("utf-8")
else:
try:
return super(DjangoJSONEncoder, self).default(o)
Expand Down
3 changes: 1 addition & 2 deletions gcloud/contrib/cleaner/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
"""
from django.dispatch import Signal


pre_delete_pipeline_instance_data = Signal(providing_args=["data"])
pre_delete_pipeline_instance_data = Signal() # providing_args=["data"]
2 changes: 1 addition & 1 deletion gcloud/core/signals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

from django.dispatch import Signal

user_enter = Signal(providing_args=["username"])
user_enter = Signal() # providing_args=["username"]
2 changes: 1 addition & 1 deletion gcloud/iam_auth/resource_creator_action/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
from django.dispatch import Signal

# defining custom signal
batch_create = Signal(providing_args=["instance_list", "creator"])
batch_create = Signal() # providing_args=["instance_list", "creator"]
8 changes: 4 additions & 4 deletions gcloud/taskflow3/signals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from django.dispatch import Signal

pre_taskflow_start = Signal(providing_args=["task_id", "executor"])
taskflow_started = Signal(providing_args=["task_id"])
taskflow_finished = Signal(providing_args=["task_id"])
taskflow_revoked = Signal(providing_args=["task_id"])
pre_taskflow_start = Signal() # providing_args=["task_id", "executor"]
taskflow_started = Signal() # providing_args=["task_id"]
taskflow_finished = Signal() # providing_args=["task_id"]
taskflow_revoked = Signal() # providing_args=["task_id"]
2 changes: 1 addition & 1 deletion gcloud/tasktmpl3/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# project_id: 模板对应的项目 ID
# template_id: 模板 ID
# is_deleted: 模板是否被删除
post_template_save_commit = Signal(providing_args=["project_id", "template_id", "is_deleted"])
post_template_save_commit = Signal() # providing_args=["project_id", "template_id", "is_deleted"]
6 changes: 3 additions & 3 deletions pipeline_web/core/signals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from django.dispatch import Signal

node_in_template_post_save = Signal(providing_args=['nodes_objs', 'nodes_info'])
node_in_template_delete = Signal(providing_args=['nodes_objs'])
node_in_template_post_save = Signal() # providing_args=['nodes_objs', 'nodes_info']
node_in_template_delete = Signal() # providing_args=['nodes_objs']

node_in_instance_post_save = Signal(providing_args=['nodes_objs', 'nodes_info'])
node_in_instance_post_save = Signal() # providing_args=['nodes_objs', 'nodes_info']

0 comments on commit 7ccb4e9

Please sign in to comment.