django-fluent/django-fluent-comments

KeyError when using FLUENT_COMMENTS_FIELD_ORDER

wfehr opened this issue · 1 comments

wfehr commented

I am using django-fluent-comments in combination with django-threadedcomments.
When I am using the "FLUENT_COMMENTS_FIELD_ORDER"-setting I get an error.
The setting itself looks like this (same as the example in README.rst):
FLUENT_COMMENTS_FIELD_ORDER = ('comment', 'name', 'email', 'url')

Here are the last lines of the traceback:

File "/usr/local/lib/python3.6/site-packages/fluent_comments/views.py" in post_comment_ajax
  79.     comment = form.get_comment_object()

File "/usr/local/lib/python3.6/site-packages/django_comments/forms.py" in get_comment_object
  121.         new = CommentModel(**self.get_comment_create_data(site_id=site_id))

File "/usr/local/lib/python3.6/site-packages/fluent_comments/forms/base.py" in get_comment_create_data
  55.         return super(AbstractCommentForm, self).get_comment_create_data(*args, **kwargs)

File "/usr/local/lib/python3.6/site-packages/threadedcomments/forms.py" in get_comment_create_data
  40.         d['parent_id'] = self.cleaned_data['parent']

Exception Type: KeyError at /comments/post/ajax/
Exception Value: 'parent'

If I don't use this setting and use the default order, everything works fine.
Also using ajax or not doesn't change a thing.

Thanks for reporting! Fixes for threaded comments are made in v1.4.3 and v2.0.2. Installing the latest version should fix your issue.