Skip to content

Commit

Permalink
picture column to long blob
Browse files Browse the repository at this point in the history
  • Loading branch information
Musa-Azeem committed Mar 31, 2024
1 parent e28ea5c commit 45784a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion backend/app/account_settings_module/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ def update_profile_picture_controller(req):
db.session.commit()
return dict(mssg='Profile Picture Updated Successfully!'), HTTPStatus.OK

except:
except Exception as e:
print(e)
return dict(error='Error Updating Profile Picture'), HTTPStatus.INTERNAL_SERVER_ERROR

def get_profile_picture_controller():
Expand Down
4 changes: 2 additions & 2 deletions backend/app/models/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ class Profile(db.Model):
email: str = db.Column(db.String(64), nullable=False, primary_key=True) # todo verify email
first_name: str = db.Column(db.String(64), nullable=False)
last_name: str = db.Column(db.String(64), nullable=False)
# Add column for profile picture as a varbinary
profile_picture: bytes = db.Column(db.LargeBinary, nullable=True)
# Add column for profile picture as long blob
profile_picture: bytes = db.Column(db.LargeBinary(length=(2**32)-1), nullable=True)
file_type: str = db.Column(db.String(64), nullable=True)
1 change: 0 additions & 1 deletion frontend/app/src/pages/AccountSettings/AccountSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ const AccountSettings = () => {
if (json.error) {
setPictureError(`Error uploading file - ${json.error}`)
}
throw new Error(`HTTP error! Status: ${response.status}`);
}

if (response.ok) {
Expand Down

0 comments on commit 45784a8

Please sign in to comment.