mirror of
https://github.com/simple-login/app.git
synced 2024-09-20 15:05:59 +08:00
fix user delete profile pic
This commit is contained in:
parent
da53b7fa00
commit
013a94d1e9
|
@ -55,12 +55,12 @@ def update_user_info():
|
|||
if data["profile_picture"] is None:
|
||||
if user.profile_picture_id:
|
||||
file = user.profile_picture
|
||||
user.profile_picture_id = None
|
||||
db.session.flush()
|
||||
if file:
|
||||
File.delete(file.id)
|
||||
s3.delete(file.path)
|
||||
|
||||
user.profile_picture_id = None
|
||||
db.session.flush()
|
||||
db.session.flush()
|
||||
else:
|
||||
raw_data = base64.decodebytes(data["profile_picture"].encode())
|
||||
file_path = random_string(30)
|
||||
|
|
|
@ -30,6 +30,7 @@ from app.email_utils import (
|
|||
)
|
||||
from app.extensions import db
|
||||
from app.models import User, CustomDomain, Alias, Contact, EmailLog
|
||||
|
||||
# flake8: noqa: E101, W191
|
||||
from tests.utils import login
|
||||
|
||||
|
|
Loading…
Reference in a new issue