Internal Server Error: /api/v1/transaction-category/9
Traceback (most recent call last):
File "/home/poblouin/code/budgetme-rest-api/env/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/home/poblouin/code/budgetme-rest-api/env/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/poblouin/code/budgetme-rest-api/env/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/poblouin/code/budgetme-rest-api/env/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
return view_func(*args, **kwargs)
File "/home/poblouin/code/budgetme-rest-api/env/lib/python3.6/site-packages/rest_framework/viewsets.py", line 95, in view
return self.dispatch(request, *args, **kwargs)
File "/home/poblouin/code/budgetme-rest-api/env/lib/python3.6/site-packages/rest_framework/views.py", line 494, in dispatch
response = self.handle_exception(exc)
File "/home/poblouin/code/budgetme-rest-api/env/lib/python3.6/site-packages/rest_framework/views.py", line 454, in handle_exception
self.raise_uncaught_exception(exc)
File "/home/poblouin/code/budgetme-rest-api/env/lib/python3.6/site-packages/rest_framework/views.py", line 491, in dispatch
response = handler(request, *args, **kwargs)
File "/home/poblouin/code/budgetme-rest-api/env/lib/python3.6/site-packages/rest_framework/mixins.py", line 70, in update
self.perform_update(serializer)
File "/home/poblouin/code/budgetme-rest-api/env/lib/python3.6/site-packages/rest_framework/mixins.py", line 80, in perform_update
serializer.save()
File "/home/poblouin/code/budgetme-rest-api/env/lib/python3.6/site-packages/rest_framework/serializers.py", line 209, in save
self.instance = self.update(self.instance, validated_data)
File "/home/poblouin/code/budgetme-rest-api/env/lib/python3.6/site-packages/rest_framework/serializers.py", line 945, in update
raise_errors_on_nested_writes('update', self, validated_data)
File "/home/poblouin/code/budgetme-rest-api/env/lib/python3.6/site-packages/rest_framework/serializers.py", line 797, in raise_errors_on_nested_writes
class_name=serializer.class.name
AssertionError: The .update()
method does not support writable nested fields by default.
Write an explicit .update()
method for serializer budgetme.apps.types.serializers.TransactionCategorySerializer
, or set read_only=True
on nested serializer fields.
[22/Feb/2018 02:03:14] "PUT /api/v1/transaction-category/9 HTTP/1.1" 500 18617