DreamStream-1 commited on
Commit
78475cc
Β·
verified Β·
1 Parent(s): cd5d194

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -4102,6 +4102,11 @@ async def handle_veterinary_product_followup(selection: str, from_number: str) -
4102
  send_whatsjet_message(from_number, "❌ No product selected. Please search for a product first.")
4103
  return
4104
 
 
 
 
 
 
4105
  if selection == '1':
4106
  # Talk to Veterinary Consultant
4107
  product_name = current_product.get('Product Name', 'the selected product')
@@ -4136,9 +4141,6 @@ async def handle_veterinary_product_followup(selection: str, from_number: str) -
4136
  current_menu_options=list(MENU_CONFIG['main_menu']['option_descriptions'].values())
4137
  )
4138
  return
4139
- else:
4140
- send_whatsjet_message(from_number, "❌ Invalid selection. Please choose 1, 2, or 3.")
4141
- return
4142
  except Exception as e:
4143
  logger.error(f"Error in product follow-up: {e}")
4144
  user_context = context_manager.get_context(from_number)
 
4102
  send_whatsjet_message(from_number, "❌ No product selected. Please search for a product first.")
4103
  return
4104
 
4105
+ # Validate that the selection is a valid follow-up option (1, 2, or 3)
4106
+ if selection not in ['1', '2', '3']:
4107
+ send_whatsjet_message(from_number, "❌ Invalid selection. Please choose 1, 2, or 3.")
4108
+ return
4109
+
4110
  if selection == '1':
4111
  # Talk to Veterinary Consultant
4112
  product_name = current_product.get('Product Name', 'the selected product')
 
4141
  current_menu_options=list(MENU_CONFIG['main_menu']['option_descriptions'].values())
4142
  )
4143
  return
 
 
 
4144
  except Exception as e:
4145
  logger.error(f"Error in product follow-up: {e}")
4146
  user_context = context_manager.get_context(from_number)