This QueryDict instance is immutable
Scenario 1: client.write_log('G414813', message='ASD plot upload', tagname='psd')
, result = 201
Scenario 2: client.write_log('G414813', message='ASD plot upload', tagname='psd', displayName='ASDs')
, result = 500
(ERROR, see below)
Scenario 3: client.write_log('G414813', message='ASD plot upload', tagname='psd', displayName='ASDs', filename='./somefile), result =
201`
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.7/dist-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/usr/local/lib/python3.7/dist-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/usr/local/lib/python3.7/dist-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/usr/local/lib/python3.7/dist-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/app/gracedb_project/gracedb/api/v1/events/views.py", line 115, in inner
return view(self, request, event, *args, **kwargs)
File "/app/gracedb_project/gracedb/api/v1/events/views.py", line 946, in post
request.data['displayName'] = displayNames[i]
File "/usr/local/lib/python3.7/dist-packages/django/http/request.py", line 513, in __setitem__
self._assert_mutable()
File "/usr/local/lib/python3.7/dist-packages/django/http/request.py", line 510, in _assert_mutable
raise AttributeError("This QueryDict instance is immutable")
Exception Type: AttributeError at /api/events/G985348/log/
Exception Value: This QueryDict instance is immutable
Request information:
USER: pycbclive
GET: No GET data
POST:
comment = 'ASD plot upload'
tagname = 'psd'
displayName = 'ASDs'
FILES: No FILES data
For some reason, not including a file, but including the displayName
parameter breaks the log creation, but it still creates the log object.
Edited by Alexander Pace