Skip to content

Commit

Permalink
few edits to allow proxy ID fields
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrDlouhy committed Oct 1, 2021
1 parent bf9552f commit da3465f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion django_comments_xtd/api/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _reverse(*args, **kwargs):
return reverse(*args, **kwargs)

form = CommentSecurityForm(obj)
ctype = ContentType.objects.get_for_model(obj)
ctype = ContentType.objects.get_for_model(obj, for_concrete_model=False)
queryset = XtdComment.objects.filter(content_type=ctype,
object_pk=obj._get_pk_val(),
site__pk=get_current_site_id(request),
Expand Down
3 changes: 3 additions & 0 deletions django_comments_xtd/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ def get_comment_dict(obj):
return dic_list


XtdComment.content_object.for_concrete_model = False


def publish_or_unpublish_nested_comments(comment, are_public=False):
qs = get_model().norel_objects.filter(~Q(pk=comment.id),
parent_id=comment.id)
Expand Down

0 comments on commit da3465f

Please sign in to comment.