From 613f50ec5b5a43655613c7dd039cfb164f41c21b Mon Sep 17 00:00:00 2001 From: "Bobby (aider)" Date: Tue, 11 Feb 2025 18:48:37 -0800 Subject: [PATCH] fix: Correct indentation for delete button in trading plan page --- src/streamlit_app.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/streamlit_app.py b/src/streamlit_app.py index d04c3c6..20768e0 100644 --- a/src/streamlit_app.py +++ b/src/streamlit_app.py @@ -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")