def upload_avatar(): form = UploadAvatarForm() if form.validate_on_submit(): image = form.image.data filename = avatars.save_avatar(image) current_user.avatar_raw = filename db.session.commit() flash(_l('Image uploaded, please crop.'), 'success') flash_errors(form) return redirect(url_for('.change_avatar'))
def upload_avatar(): form = UploadAvatarForm() if form.validate_on_submit(): image = form.image.data filename = avatars.save_avatar(image) current_user.avatar_raw = filename db.session.commit() flash(_('Изображение загружено, пожалуйста обрежьте.'), 'success') flash_errors(form) return redirect(url_for('.change_avatar'))