goodtables.io icon indicating copy to clipboard operation
goodtables.io copied to clipboard

Exception when not providing `name` in new source endpoint

Open amercader opened this issue 8 years ago • 3 comments

ERROR:goodtablesio.blueprints.api:AttributeError("'NoneType' object has no attribute 'get'",)
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.5/site-packages/flask/app.py", line 1625, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/srv/app/goodtablesio/utils/backend.py", line 49, in decorated_view
    return view(*args, user=user, **kwargs)
  File "/srv/app/goodtablesio/blueprints/api.py", line 62, in source_create
    name = data.get('name')
AttributeError: 'NoneType' object has no attribute 'get'

amercader avatar Jul 11 '17 14:07 amercader

@amercader I would say if not providing payload at all (may be incorrect content-type?)

roll avatar Jul 11 '17 14:07 roll

You are right, I didn't send any payload

amercader avatar Jul 11 '17 14:07 amercader

I think we still need to rename this issue and fix by returning API Error and 400 if no payload. Could be low priority..

roll avatar Jul 11 '17 14:07 roll