Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LLM-Filter
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2026_NGIT
LLM-Filter
Commits
befb2764
Commit
befb2764
authored
Dec 13, 2025
by
uuo00_n
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(dashboard): 确保teacher_person_id和created_at的正确格式
修复teacher_person_id可能为字符串时的ObjectId转换问题 确保created_at字段返回ISO格式的字符串
parent
6d17b883
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
dashboard.py
app/services/dashboard.py
+4
-1
No files found.
app/services/dashboard.py
View file @
befb2764
...
@@ -205,6 +205,9 @@ async def homeroom_current_summary(current_user: Dict[str, Any]) -> Dict[str, An
...
@@ -205,6 +205,9 @@ async def homeroom_current_summary(current_user: Dict[str, Any]) -> Dict[str, An
teacher
=
await
_get_teacher_entity
(
current_user
[
"_id"
],
binding
)
teacher
=
await
_get_teacher_entity
(
current_user
[
"_id"
],
binding
)
teacher_person_id
=
teacher
.
get
(
"person_id"
)
teacher_person_id
=
teacher
.
get
(
"person_id"
)
if
isinstance
(
teacher_person_id
,
str
)
and
ObjectId
.
is_valid
(
teacher_person_id
):
teacher_person_id
=
ObjectId
(
teacher_person_id
)
classes
=
[]
classes
=
[]
# 使用 person_id 查询班级
# 使用 person_id 查询班级
cursor
=
db
.
db
.
classes
.
find
({
"head_teacher_person_id"
:
teacher_person_id
})
cursor
=
db
.
db
.
classes
.
find
({
"head_teacher_person_id"
:
teacher_person_id
})
...
@@ -255,7 +258,7 @@ async def homeroom_current_summary(current_user: Dict[str, Any]) -> Dict[str, An
...
@@ -255,7 +258,7 @@ async def homeroom_current_summary(current_user: Dict[str, Any]) -> Dict[str, An
async
for
d
in
cursor
:
async
for
d
in
cursor
:
directives
.
append
({
directives
.
append
({
"content"
:
d
.
get
(
"content"
),
"content"
:
d
.
get
(
"content"
),
"created_at"
:
d
.
get
(
"created_at"
),
"created_at"
:
d
.
get
(
"created_at"
)
.
isoformat
()
if
isinstance
(
d
.
get
(
"created_at"
),
datetime
)
else
d
.
get
(
"created_at"
)
,
})
})
return
{
return
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment