fix: Correct indentation for delete button in trading plan page

This commit is contained in:
Bobby (aider) 2025-02-11 18:48:37 -08:00
parent 9369eadd47
commit 613f50ec5b

View File

@ -1078,15 +1078,17 @@ def trading_plan_page():
update_trading_plan(plan)
st.success("Plan updated successfully!")
st.experimental_set_query_params(rerun=True)
# Add delete button
if st.button("Delete Plan", key="delete_plan_button"):
try:
delete_trading_plan(plan.id)
st.success("Plan deleted successfully!")
st.experimental_set_query_params(rerun=True)
except Exception as e:
st.error(f"Error deleting plan: {str(e)}")
except Exception as e:
st.error(f"Error updating plan: {str(e)}")
# Delete button (at the same level as the update button)
if st.button("Delete Plan", key="delete_plan_button"):
try:
delete_trading_plan(plan.id)
st.success("Plan deleted successfully!")
st.experimental_set_query_params(rerun=True)
except Exception as e:
st.error(f"Error deleting plan: {str(e)}")
else:
st.info("No plans available to edit")