Skip to content

Commit 811713e

Browse files
committed
few edits to allow proxy ID fields
1 parent a17dd5b commit 811713e

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

django_comments_xtd/api/frontend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _reverse(*args, **kwargs):
5959
return reverse(*args, **kwargs)
6060

6161
form = CommentSecurityForm(obj)
62-
ctype = ContentType.objects.get_for_model(obj)
62+
ctype = ContentType.objects.get_for_model(obj, for_concrete_model=False)
6363
queryset = XtdComment.objects.filter(content_type=ctype,
6464
object_pk=obj._get_pk_val(),
6565
site__pk=get_current_site_id(request),

django_comments_xtd/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ def get_comment_create_data(self, site_id=None):
6464
data.update({'thread_id': 0, 'level': 0, 'order': 1,
6565
'parent_id': self.cleaned_data['reply_to'],
6666
'followup': self.cleaned_data['followup'],
67-
'content_object': target})
67+
})
6868
return data

django_comments_xtd/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ def get_comment_dict(obj):
220220
return dic_list
221221

222222

223+
XtdComment.content_object.for_concrete_model = False
224+
225+
223226
def publish_or_unpublish_nested_comments(comment, are_public=False):
224227
qs = get_model().norel_objects.filter(~Q(pk=comment.id),
225228
parent_id=comment.id)

0 commit comments

Comments
 (0)