非法操作 месяцев назад: 6
Родитель
Сommit
5019547d33
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      api/models/tools.py

+ 2 - 0
api/models/tools.py

@@ -102,6 +102,8 @@ class ApiToolProvider(Base):
 
     @property
     def user(self) -> Account | None:
+        if not self.user_id:
+            return None
         return db.session.query(Account).filter(Account.id == self.user_id).first()
 
     @property