Skip to content

Commit 45784a8

Browse files
committed
picture column to long blob
1 parent e28ea5c commit 45784a8

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

backend/app/account_settings_module/controller.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ def update_profile_picture_controller(req):
129129
db.session.commit()
130130
return dict(mssg='Profile Picture Updated Successfully!'), HTTPStatus.OK
131131

132-
except:
132+
except Exception as e:
133+
print(e)
133134
return dict(error='Error Updating Profile Picture'), HTTPStatus.INTERNAL_SERVER_ERROR
134135

135136
def get_profile_picture_controller():

backend/app/models/profile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ class Profile(db.Model):
66
email: str = db.Column(db.String(64), nullable=False, primary_key=True) # todo verify email
77
first_name: str = db.Column(db.String(64), nullable=False)
88
last_name: str = db.Column(db.String(64), nullable=False)
9-
# Add column for profile picture as a varbinary
10-
profile_picture: bytes = db.Column(db.LargeBinary, nullable=True)
9+
# Add column for profile picture as long blob
10+
profile_picture: bytes = db.Column(db.LargeBinary(length=(2**32)-1), nullable=True)
1111
file_type: str = db.Column(db.String(64), nullable=True)

frontend/app/src/pages/AccountSettings/AccountSettings.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ const AccountSettings = () => {
129129
if (json.error) {
130130
setPictureError(`Error uploading file - ${json.error}`)
131131
}
132-
throw new Error(`HTTP error! Status: ${response.status}`);
133132
}
134133

135134
if (response.ok) {

0 commit comments

Comments
 (0)