fix: Logging error for logged in user (#2613)
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

This commit is contained in:
shaohuzhang1 2025-03-19 12:07:46 +08:00 committed by GitHub
parent 4b4b84a220
commit b7accc54e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,7 @@
@date2025/3/14 16:09
@desc:
"""
from gettext import gettext
from setting.models.log_management import Log
@ -31,6 +32,10 @@ def _get_user(request):
@return:
"""
user = request.user
if user is None:
return {
"user_name": gettext('unknown')
}
return {
"id": str(user.id),
"email": user.email,