tatianija commited on
Commit
99d9c88
·
verified ·
1 Parent(s): 81ee216

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -16
app.py CHANGED
@@ -769,27 +769,22 @@ def fetch_questions() -> Tuple[str, Optional[pd.DataFrame]]:
769
  display_data = []
770
  for item in questions_data:
771
  # Check for attachments
772
- has_attachments = False
773
- attachment_info = ""
774
-
775
- # Check various fields for attachments
776
- attachment_fields = ['attachments', 'files', 'media', 'resources']
777
- for field in attachment_fields:
778
- if field in item and item[field]:
779
- has_attachments = True
780
- if isinstance(item[field], list):
781
- attachment_info += f"{len(item[field])} {field}, "
782
- else:
783
- attachment_info += f"{field}, "
784
 
 
 
 
 
 
785
  # Check if question contains URLs
786
  question_text = item.get("question", "")
787
  if 'http' in question_text:
788
- has_attachments = True
789
- attachment_info += "URLs in text, "
790
 
791
- if attachment_info:
792
- attachment_info = attachment_info.rstrip(", ")
793
 
794
  display_data.append({
795
  "Task ID": item.get("task_id", "Unknown"),
 
769
  display_data = []
770
  for item in questions_data:
771
  # Check for attachments
772
+ has_file = False
773
+ file_info = ""
 
 
 
 
 
 
 
 
 
 
774
 
775
+ file_name = item.get("file_name", "")
776
+ if file_name and file_name.strip():
777
+ has_file = True
778
+ file_info = file_name
779
+
780
  # Check if question contains URLs
781
  question_text = item.get("question", "")
782
  if 'http' in question_text:
783
+ has_file = True
784
+ file_info += "URLs in text, "
785
 
786
+ if file_infofile_info:
787
+ file_info = attachment_info.rstrip(", ")
788
 
789
  display_data.append({
790
  "Task ID": item.get("task_id", "Unknown"),