Spaces:
Sleeping
Sleeping
Commit
·
9d54669
1
Parent(s):
9d2fe8f
Initialize email_text variable in update_ui function to prevent potential reference errors. This change ensures that the email_text is defined before use, contributing to a more robust and error-free email generation process.
Browse files
app.py
CHANGED
@@ -168,6 +168,8 @@ def update_ui(message, cv_file, cv_text):
|
|
168 |
# Create placeholder for the generated email
|
169 |
email_placeholder = st.empty()
|
170 |
|
|
|
|
|
171 |
# Generate button
|
172 |
if st.button("Generate Email", key="generate_button"):
|
173 |
if message and cv_file and isinstance(cv_text, str) and not cv_text.startswith("Error"):
|
@@ -206,6 +208,7 @@ def update_ui(message, cv_file, cv_text):
|
|
206 |
if sender_email and receiver_email and email_body:
|
207 |
send_email(sender_email, receiver_email, subject, email_body, cv_file.name)
|
208 |
|
|
|
209 |
# Add tabs for different sections
|
210 |
tab1, tab2 = st.tabs(["Generate Email", "View CV Details"])
|
211 |
|
|
|
168 |
# Create placeholder for the generated email
|
169 |
email_placeholder = st.empty()
|
170 |
|
171 |
+
email_text = "" # Initialize email_text before use
|
172 |
+
|
173 |
# Generate button
|
174 |
if st.button("Generate Email", key="generate_button"):
|
175 |
if message and cv_file and isinstance(cv_text, str) and not cv_text.startswith("Error"):
|
|
|
208 |
if sender_email and receiver_email and email_body:
|
209 |
send_email(sender_email, receiver_email, subject, email_body, cv_file.name)
|
210 |
|
211 |
+
|
212 |
# Add tabs for different sections
|
213 |
tab1, tab2 = st.tabs(["Generate Email", "View CV Details"])
|
214 |
|