Closed spaude11 closed 7 months ago
Description: The objective of this issue was to first integrate the method for sending the feedback files to dropbox. Report issues that we will encounter while integrating the function. I came across few issues, I have provided the details below:
Steps to reproduce: Run the file in local host. Write the feedback and submit it. If there are no errors then file will be created and sent to the dropbox. If there are issues, the error will be shown below.
Expected Vs Actual Behaviour: For few times, the file was created and sent to dropbox. But I wanted to make some changes on how the files will be stored. I made some change and later some part of code starts to error. The expected behavior is: PDF file should be generated and sent to the dropbox with date and time format in each file for identification Actual Behaviour: The files were created, at first the file was replacing that file we had in dropbox but later when I made some changes to generate the file name according to time stamp, It started erroring.
Code Snippets:
` pdf_filename, pdf_content = generate_pdf(feedback_data)
dropbox_logger = DropboxLogger(DROPBOX_ACCESS_TOKEN)
dropbox_logger.upload_file(pdf_content, "/Apps/Feedbackfiles/feedback_report.pdf", st)
# Display success message
st.markdown("### Generated PDF:")
st.success("Thank you for your feedback! 🚀")`
Environment Details: DropBox, Pycharm, Github, Streamlit
For Issue Resolution:
I will make some changes in the code again for streamlit to generate and send the file into dropbox without erroring in naming.
Descritption: The objective of this issue was to first integrate the method for sending the feedback files to dropbox. I came across one issue while sending the file to the dropbox.
Steps to reproduce: Run the file in local host. Write the feedback and submit it. If there are no errors then file will be created and sent to the dropbox. If there are issues, the error will be shown below.
Expected Vs Actual Behaviour: The code was supposed to send the feedback file into the directory. I gave a unique file name based on the user's email address.
But firstly it was not able to generate the file. Firstly the errror was it wasn't able to generate file but later the file was not able to send in the drop box.
Code Snippets:
def upload_file(self, file_data, file_name, st, user_email):
try:
# Construct the new filename with the user's email
new_file_name = f"feedback_report_{user_email}.pdf"
# Upload the file to Dropbox
upload_path = f'/Apps/Feedbackfiles/{new_file_name}'
self.dbx.files_upload(file_data, upload_path)
st.success(f"Feedback PDF '{new_file_name}' uploaded successfully to Dropbox.")
except dropbox.exceptions.ApiError as e:
st.error(f"Error uploading '{file_name}' to Dropbox: {e}")
Environment Details: DropBox, Pycharm, Github, Streamlit
For Issue Resolution:
Made some changes on how the file was generated in upload_file class. Now for each unique email address the file will be sent to drop box.
@spaude11 This is great but it does seem to make an assumption that a person will only ever want to submit feedback once. I think this is fine but just wanted to point it out. I think this is great! I'm glad you got it fixed. You showed us the errors you got when we were in class Monday.
Description: We need to make sure that users can submit answers to our feedback page questions and they get sent to the DropBox we set up.
Expected Outcome: All submissions should be sent to the DropBox and can be viewed by our team members.
Additional context After confirming this works as intended, we will want to save the submissions in a .txt file instead as an image.