Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TypeError at /api/v1/store/products/create/
- Got a `TypeError` when calling `Product.objects.create()`. This may be because you have a writable field on the serializer class that is not a valid argument to `Product.objects.create()`. You may need to make the field read-only, or override the ProductCreateSerializer.create() method to handle this correctly.
- Original exception was:
- Traceback (most recent call last):
- File "/usr/local/lib/python3.8/site-packages/rest_framework/serializers.py", line 948, in create
- instance = ModelClass._default_manager.create(**validated_data)
- File "/usr/local/lib/python3.8/site-packages/django/db/models/manager.py", line 82, in manager_method
- return getattr(self.get_queryset(), name)(*args, **kwargs)
- File "/usr/local/lib/python3.8/site-packages/modeltranslation/manager.py", line 362, in create
- return super(MultilingualQuerySet, self).create(**kwargs)
- File "/usr/local/lib/python3.8/site-packages/django/db/models/query.py", line 420, in create
- obj = self.model(**kwargs)
- File "/usr/local/lib/python3.8/site-packages/modeltranslation/translator.py", line 264, in new_init
- old_init(self, *args, **kwargs)
- File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 501, in __init__
- raise TypeError("%s() got an unexpected keyword argument '%s'" % (cls.__name__, kwarg))
- TypeError: Product() got an unexpected keyword argument 'seller'
Advertisement
Add Comment
Please, Sign In to add comment