New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
serialize causing: AttributeError: 'NoneType' object has no attribute 'split' #346
Comments
Which query are you using before the call of serialize function? |
This doesn't look like an issue with the orm but an issue with Masonite setting the response code. Can we see a code example of your controller method? |
Hi, sorry late reply. This is what I'm calling after the query.
|
@Marlysson can you replicate this? This doesn't throw that error. It looks as if the response cannot get a status. in Masonite. If anything it looks like a Masonite issue
|
Sure. I'll try this. |
Thanks Guys :) |
I can't replicate this error. @jpmateo022 Can you provide more about your workflow until the final response? With this snippet everything works fine: bulk = [{
"age": 15,
"is_admin": False,
"role": "TEST"
},
{
"age": 25,
"is_admin": True,
"role": "DEVELOPER",
},
{
"age": 12,
"is_admin": False,
"role": "SUPERVISOR",
}]
Model.bulk_create(bulk)
data = Model.all().serialize()
return response.json({
'code': 200,
'message': 'Success',
'data': data
},200) |
Hi, I'm moving this to the masonite framework. |
Have anyone experiencing this? It seems it happens in serialize function
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/gunicorn/workers/gthread.py", line 271, in handle
keepalive = self.handle_request(req, conn)
File "/usr/local/lib/python3.8/dist-packages/gunicorn/workers/gthread.py", line 320, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/usr/local/lib/python3.8/dist-packages/whitenoise/base.py", line 86, in call
return self.application(environ, start_response)
File "/usr/local/lib/python3.8/dist-packages/masonite/wsgi.py", line 42, in response_handler
start_response(response.get_status_code(), response.get_and_reset_headers())
File "/usr/local/lib/python3.8/dist-packages/gunicorn/http/wsgi.py", line 239, in start_response
self.status_code = int(self.status.split()[0])
AttributeError: 'NoneType' object has no attribute 'split'
The text was updated successfully, but these errors were encountered: