After upgrade: "Statement matching query does not exist"
After upgrading the code I got a new bug. This is happening when I type in a unknown word for the ChatterBot.
Internal Server Error: /api/chatterbot/
Traceback (most recent call last):
File "/home/chrisp/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/home/chrisp/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/chrisp/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/chrisp/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/home/chrisp/lib/python3.6/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/home/chrisp/lib/python3.6/site-packages/chatterbot/ext/django_chatterbot/views.py", line 78, in post
response = self.chatterbot.get_response(input_data, conversation.id)
File "/home/chrisp/lib/python3.6/site-packages/chatterbot/chatterbot.py", line 119, in get_response
self.storage.add_to_conversation(conversation_id, statement, response)
File "/home/chrisp/lib/python3.6/site-packages/chatterbot/storage/django_storage.py", line 176, in add_to_conversation
first_response = Statement.objects.get(text=response.text)
File "/home/chrisp/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/chrisp/lib/python3.6/site-packages/django/db/models/query.py", line 380, in get
self.model._meta.object_name
chatterbot.ext.django_chatterbot.models.DoesNotExist: Statement matching query does not exist.
A line probably needs to be modified in there to create that statement. I probably missed it when I did the conversation changes for #828
+1, affected by bug.
Solution is to downgrade to 0.7.6 for the moment. (At least that worked for me.)
Confirm this bug is still there in 0.8.1. The workaround is to stop self-learning by adding the following to Django's settings.py: CHATTERBOT = { ####### 'read_only': True, ####### }
agree @phdggg , this bug is still in 0.8.2.
This should be fixed now that #1391 has resulted in the removal of the Conversation model.