Skip to content

Commit cdd39fc

Browse files
committed
fix: Audit log login did not record user
1 parent 394d969 commit cdd39fc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/common/log/log.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def _get_user(request):
3434
user = request.user
3535
if user is None:
3636
return {
37-
"user_name": gettext('unknown')
37+
3838
}
3939
return {
4040
"id": str(user.id),

apps/users/views/user.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class Login(APIView):
179179
responses=LoginSerializer().get_response_body_api(),
180180
security=[],
181181
tags=[_("User")])
182-
@log(menu='User', operate='Log in', get_user=lambda r: {'user_name': r.data.get('username', None)},
182+
@log(menu='User', operate='Log in', get_user=lambda r: {'username': r.data.get('username', None)},
183183
get_details=_get_details,
184184
get_operation_object=lambda r, k: {'name': r.data.get('username')})
185185
def post(self, request: Request):

0 commit comments

Comments
 (0)