fix: default avatar missing after signup in non-kiosk mode
This commit is contained in:
parent
2be7bf7683
commit
1823759433
1 changed files with 13 additions and 11 deletions
|
@ -35,7 +35,9 @@ def signup_user(args: FormsDict, files: FormsDict, db: MatematDatabase) -> User:
|
|||
# Finally, set the avatar, if provided
|
||||
if 'avatar' in files:
|
||||
avatar = files.avatar.file.read()
|
||||
if len(avatar) > 0:
|
||||
else:
|
||||
avatar = None
|
||||
if avatar:
|
||||
filemagic: magic.FileMagic = magic.detect_from_content(avatar)
|
||||
if filemagic.mime_type.startswith('image/'):
|
||||
abspath: str = os.path.join(os.path.abspath(config['UploadDir']), 'thumbnails/users/')
|
||||
|
|
Loading…
Reference in a new issue