Skip to content

Commit

Permalink
minor: update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
narasux committed Mar 7, 2024
1 parent b3c7d24 commit 0843060
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/bk-user/bkuser/apis/web/data_source/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def put(self, request, *args, **kwargs):

@swagger_auto_schema(
tags=["data_source"],
operation_description="软删除数据源",
operation_description="删除数据源",
responses={status.HTTP_204_NO_CONTENT: ""},
)
def delete(self, request, *args, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def get_queryset(self):
data = slz.validated_data
data_source_id = self.kwargs["id"]

# 数据源处于启用 / 停用状态下都可以查询用户,但是软删除状态下不行
# 数据源处于启用 / 停用状态下都可以查询用户
data_source = DataSource.objects.filter(
id=data_source_id,
owner_tenant_id=self.get_current_tenant_id(),
Expand Down
2 changes: 1 addition & 1 deletion src/bk-user/bkuser/apis/web/idp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def put(self, request, *args, **kwargs):


class IdpSwitchStatusApi(CurrentUserTenantMixin, ExcludePutAPIViewMixin, generics.UpdateAPIView):
"""切换租户状态(启/停)"""
"""切换认证源状态(启/停)"""

permission_classes = [IsAuthenticated, perm_class(PermAction.MANAGE_TENANT)]
serializer_class = IdpSwitchStatusOutputSLZ
Expand Down
2 changes: 1 addition & 1 deletion src/bk-user/bkuser/apis/web/tenant/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def put(self, request, *args, **kwargs):

@swagger_auto_schema(
tags=["tenant"],
operation_description="软删除租户",
operation_description="删除租户",
responses={status.HTTP_204_NO_CONTENT: ""},
)
def delete(self, request, *args, **kwargs):
Expand Down
8 changes: 4 additions & 4 deletions src/bk-user/bkuser/apps/notification/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def build_and_run_notify_password_expiring_users_task():
"""构建并运行即将过期通知任务"""
logger.info("[celery] receive period task: build_and_run_notify_password_expiring_users_task")

# 对于停用 / 软删除的数据源,不发送密码即将过期提醒
# 对于停用的数据源,不发送密码即将过期提醒
for data_source in DataSource.objects.filter(
plugin_id=DataSourcePluginEnum.LOCAL, status=DataSourceStatus.ENABLED
):
Expand Down Expand Up @@ -113,7 +113,7 @@ def build_and_run_notify_password_expired_users_task():
"""构建并运行过期通知任务"""
logger.info("[celery] receive period task: build_and_run_notify_password_expired_users_task")

# 对于停用 / 软删除的数据源,不发送密码过期提醒
# 对于停用的数据源,不发送密码过期提醒
for data_source in DataSource.objects.filter(
plugin_id=DataSourcePluginEnum.LOCAL, status=DataSourceStatus.ENABLED
):
Expand Down Expand Up @@ -156,7 +156,7 @@ def build_and_run_notify_expiring_tenant_users_task():
"""构建并运行即将过期通知任务"""
logger.info("[celery] receive period task: build_and_run_notify_expiring_tenant_users_task")

# 对于停用 / 软删除的租户,不需要对即将过期的租户用户进行提醒
# 对于停用的租户,不需要对即将过期的租户用户进行提醒
for tenant_id in Tenant.objects.filter(status=TenantStatus.ENABLED).values_list("id", flat=True):
notify_expiring_tenant_users.delay(tenant_id)

Expand Down Expand Up @@ -190,6 +190,6 @@ def build_and_run_notify_expired_tenant_users_task():
"""构建并运行过期通知任务"""
logger.info("[celery] receive period task: build_and_run_notify_expired_tenant_users_task")

# 对于停用 / 软删除的租户,不需要对过期的租户用户进行提醒
# 对于停用的租户,不需要对过期的租户用户进行提醒
for tenant_id in Tenant.objects.filter(status=TenantStatus.ENABLED).values_list("id", flat=True):
notify_expired_tenant_users.delay(tenant_id)
2 changes: 1 addition & 1 deletion src/bk-user/bkuser/biz/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ def create_local_data_source_with_merge_config(

@staticmethod
def get_tenant_available_data_sources(tenant_id: str) -> List[DataSource]:
"""获取租户有查看的数据源,包括拥有的以及协同的"""
"""获取租户能查看的数据源,包括拥有的以及协同的"""
# TODO (su) 考虑租户协同的情况
return DataSource.objects.filter(owner_tenant_id=tenant_id)
4 changes: 2 additions & 2 deletions src/bk-user/tests/apis/web/tenant/test_tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def test_create(self, api_client, default_tenant):
"scene": "user_initialize",
"title": "初始化密码",
"sender": "admin",
"content": "您的初始密码为:{{password}}",
"content_html": "您的初始密码为:{{password}}",
"content": "您的初始密码为: {{ password }}",
"content_html": "您的初始密码为: {{ password }}",
}
],
},
Expand Down

0 comments on commit 0843060

Please sign in to comment.