Skip to content

Commit 2ab444a

Browse files
authored
Merge pull request #99 from BUAA-SE-coders007/fix/98
[fix]: 修复文献库文献转储路径
2 parents e0aff9f + 13181ea commit 2ab444a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

app/api/v1/endpoints/articleDB.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ async def copy_article(folder_id: int, article_id: int, is_group: bool | None =
131131
raise HTTPException(status_code=500, detail=str(e))
132132
return {"msg": "Article copied successfully", "new_article_id": new_article_id}
133133

134-
135134
@router.get("/recommend", response_model=dict)
136135
async def recommend_article(recommend_article: RecommendArticle = Depends(), db: AsyncSession = Depends(get_db)):
137136
articles = await recommend_article_in_db(db=db, recommend_article=recommend_article)

app/curd/articleDB.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ async def get_article_info_in_db_by_id(db: AsyncSession, article_id: int):
7777
"""
7878
result = await db.execute(select(ArticleDB).where(ArticleDB.id == article_id))
7979
article = result.scalars().first()
80+
if not article:
81+
return None, None
8082
return article.file_path, article.title
8183

8284
async def recommend_article_in_db(db: AsyncSession, recommend_article: RecommendArticle):

0 commit comments

Comments
 (0)