Skip to content

Commit

Permalink
feat: audit for password modification #289
Browse files Browse the repository at this point in the history
  • Loading branch information
Canway-shiisa committed Mar 21, 2022
1 parent 31ecb36 commit 8221c26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/saas/bkuser_shell/apis/viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def _prepare_headers(
self, request,
force_action_id: str = "",
no_auth: bool = False,
user_from_token: bool = False):
user_from_token: bool = False
):
"""构建通用 Headers"""
headers = make_default_headers(request.user.username)
ip = self.get_client_ip(request)
Expand All @@ -94,7 +95,6 @@ def _prepare_headers(
settings.API_FORCE_NO_CACHE_HEADER_NAME: True,
}
)

if user_from_token:
headers.update(
{
Expand Down
3 changes: 1 addition & 2 deletions src/saas/bkuser_shell/password/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ def reset_by_token(self, request, validated_data):
body = {"password": password}

# 调用后台接口重置密码
profiles_api_instance.v2_profiles_partial_update(
lookup_value=profile.id, body=body, lookup_field="id")
profiles_api_instance.v2_profiles_partial_update(lookup_value=profile.id, body=body, lookup_field="id")

return Response(data={})

Expand Down

0 comments on commit 8221c26

Please # to comment.