def my_profile_upload_picture(): form = PictureForm() # TODO: Is it possible for 'X-Upload-Too-Big' to be in request.headers, # and if so, should we deal with it? if form.validate(): if form.picture.has_file(): set_user_picture(current_user, form.picture) db.session.add(current_user) db.session.commit() return ('', 204) abort(400)
def my_profile_upload_picture(): form = PictureForm() # TODO: Is it possible for 'X-Upload-Too-Big' to be in request.headers, # and if so, should we deal with it? if form.validate(): if form.picture.has_file(): set_user_picture(current_user, form.picture) db.session.add(current_user) db.session.commit() signals.user_changed_profile.send( current_app._get_current_object(), user=current_user._get_current_object(), avatar_changed=True ) return ('', 204) abort(400)