mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 11:26:52 +08:00
chore: refurish python code by applying Pylint linter rules (#8322)
This commit is contained in:
@@ -284,9 +284,9 @@ class Document(db.Model):
|
||||
status = None
|
||||
if self.indexing_status == "waiting":
|
||||
status = "queuing"
|
||||
elif self.indexing_status not in ["completed", "error", "waiting"] and self.is_paused:
|
||||
elif self.indexing_status not in {"completed", "error", "waiting"} and self.is_paused:
|
||||
status = "paused"
|
||||
elif self.indexing_status in ["parsing", "cleaning", "splitting", "indexing"]:
|
||||
elif self.indexing_status in {"parsing", "cleaning", "splitting", "indexing"}:
|
||||
status = "indexing"
|
||||
elif self.indexing_status == "error":
|
||||
status = "error"
|
||||
@@ -331,7 +331,7 @@ class Document(db.Model):
|
||||
"created_at": file_detail.created_at.timestamp(),
|
||||
}
|
||||
}
|
||||
elif self.data_source_type == "notion_import" or self.data_source_type == "website_crawl":
|
||||
elif self.data_source_type in {"notion_import", "website_crawl"}:
|
||||
return json.loads(self.data_source_info)
|
||||
return {}
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ class App(db.Model):
|
||||
return False
|
||||
if self.app_model_config.agent_mode_dict.get("enabled", False) and self.app_model_config.agent_mode_dict.get(
|
||||
"strategy", ""
|
||||
) in ["function_call", "react"]:
|
||||
) in {"function_call", "react"}:
|
||||
self.mode = AppMode.AGENT_CHAT.value
|
||||
db.session.commit()
|
||||
return True
|
||||
@@ -1501,6 +1501,6 @@ class TraceAppConfig(db.Model):
|
||||
"tracing_provider": self.tracing_provider,
|
||||
"tracing_config": self.tracing_config_dict,
|
||||
"is_active": self.is_active,
|
||||
"created_at": self.created_at.__str__() if self.created_at else None,
|
||||
"updated_at": self.updated_at.__str__() if self.updated_at else None,
|
||||
"created_at": str(self.created_at) if self.created_at else None,
|
||||
"updated_at": str(self.updated_at) if self.updated_at else None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user