Spaces:
Sleeping
Sleeping
Update models.py
Browse files
models.py
CHANGED
|
@@ -813,10 +813,9 @@ def profile_added_db(first_name, last_name, organisation, industry, bio):
|
|
| 813 |
logging.error(f"Unexpected error: {e}")
|
| 814 |
return jsonify({"error":"Failed to update profile"}), 500
|
| 815 |
finally:
|
| 816 |
-
|
| 817 |
-
|
| 818 |
-
|
| 819 |
-
logging.info("Database connection closed.")
|
| 820 |
|
| 821 |
|
| 822 |
def view_profile_db():
|
|
@@ -864,10 +863,9 @@ def view_profile_db():
|
|
| 864 |
logging.error(f"Unexpected error: {e}")
|
| 865 |
return jsonify({"error": f"Unexpected error: {str(e)}"}), 500
|
| 866 |
finally:
|
| 867 |
-
|
| 868 |
-
|
| 869 |
-
|
| 870 |
-
logging.info("Database connection closed.")
|
| 871 |
|
| 872 |
|
| 873 |
|
|
@@ -929,9 +927,8 @@ def view_quiz_score_db(user_id, theme_table, theme, quiz_id):
|
|
| 929 |
return jsonify({"error": "Unable to fetch quiz score"}), 500
|
| 930 |
|
| 931 |
finally:
|
| 932 |
-
|
| 933 |
-
|
| 934 |
-
connection.close()
|
| 935 |
|
| 936 |
|
| 937 |
|
|
|
|
| 813 |
logging.error(f"Unexpected error: {e}")
|
| 814 |
return jsonify({"error":"Failed to update profile"}), 500
|
| 815 |
finally:
|
| 816 |
+
cursor.close()
|
| 817 |
+
connection.close()
|
| 818 |
+
logging.info("Database connection closed.")
|
|
|
|
| 819 |
|
| 820 |
|
| 821 |
def view_profile_db():
|
|
|
|
| 863 |
logging.error(f"Unexpected error: {e}")
|
| 864 |
return jsonify({"error": f"Unexpected error: {str(e)}"}), 500
|
| 865 |
finally:
|
| 866 |
+
cursor.close()
|
| 867 |
+
connection.close()
|
| 868 |
+
logging.info("Database connection closed.")
|
|
|
|
| 869 |
|
| 870 |
|
| 871 |
|
|
|
|
| 927 |
return jsonify({"error": "Unable to fetch quiz score"}), 500
|
| 928 |
|
| 929 |
finally:
|
| 930 |
+
cursor.close()
|
| 931 |
+
connection.close()
|
|
|
|
| 932 |
|
| 933 |
|
| 934 |
|