katerinka28

Untitled

May 20th, 2021
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. TypeError at /api/v1/store/products/create/
  2. 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.
  3. Original exception was:
  4. Traceback (most recent call last):
  5. File "/usr/local/lib/python3.8/site-packages/rest_framework/serializers.py", line 948, in create
  6. instance = ModelClass._default_manager.create(**validated_data)
  7. File "/usr/local/lib/python3.8/site-packages/django/db/models/manager.py", line 82, in manager_method
  8. return getattr(self.get_queryset(), name)(*args, **kwargs)
  9. File "/usr/local/lib/python3.8/site-packages/modeltranslation/manager.py", line 362, in create
  10. return super(MultilingualQuerySet, self).create(**kwargs)
  11. File "/usr/local/lib/python3.8/site-packages/django/db/models/query.py", line 420, in create
  12. obj = self.model(**kwargs)
  13. File "/usr/local/lib/python3.8/site-packages/modeltranslation/translator.py", line 264, in new_init
  14. old_init(self, *args, **kwargs)
  15. File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 501, in __init__
  16. raise TypeError("%s() got an unexpected keyword argument '%s'" % (cls.__name__, kwarg))
  17. TypeError: Product() got an unexpected keyword argument 'seller'
Advertisement
Add Comment
Please, Sign In to add comment