Description:
The filename variable is only defined if a file is uploaded, which can lead to an UnboundLocalError when the add_registration procedure is called without an uploaded file.
Suggested Fix:
Initialize filename to None at the start of the file upload logic.
Update the stored procedure to handle NULL values for filename or provide a default value.
Description: The filename variable is only defined if a file is uploaded, which can lead to an UnboundLocalError when the add_registration procedure is called without an uploaded file.
Suggested Fix: