Skip to content

Commit

Permalink
Fix crash with kinto validated headers
Browse files Browse the repository at this point in the history
  • Loading branch information
gabisurita committed Feb 13, 2017
1 parent a673f8e commit 87900c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kinto_attachment/utils.py
Expand Up @@ -31,6 +31,7 @@ def __init__(self, request):
self.resource_name = 'record'
try:
resource = Record(request, context=self)
resource.request.validated = {'header': {}, 'querystring': {}}
request.current_resource_name = 'record'
existing = resource.get()
except httpexceptions.HTTPNotFound:
Expand Down Expand Up @@ -86,7 +87,7 @@ def patch_record(record, request):
request.matched_route.pattern = record_pattern

# Simulate update of fields.
request.validated = record
request.validated = {'header': {}, 'querystring': {}, 'body': record}
request.body = json.dumps(record).encode('utf-8')
resource = Record(request, context=context)
request.current_resource_name = 'record'
Expand Down

0 comments on commit 87900c6

Please sign in to comment.