Skip to content

Commit

Permalink
fix: app_count of dataset is error when apps was deleted (#4810)
Browse files Browse the repository at this point in the history
  • Loading branch information
DomKing authored May 30, 2024
1 parent 4308a79 commit 38a470a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/models/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def latest_process_rule(self):

@property
def app_count(self):
return db.session.query(func.count(AppDatasetJoin.id)).filter(AppDatasetJoin.dataset_id == self.id).scalar()
return db.session.query(func.count(AppDatasetJoin.id)).filter(AppDatasetJoin.dataset_id == self.id,
App.id == AppDatasetJoin.app_id).scalar()

@property
def document_count(self):
Expand Down

0 comments on commit 38a470a

Please sign in to comment.