#12812: Inheriting from comments breaks comment moderation
----------------------------------------------+-----------------------------
Reporter: Beetle_B | Owner: nobody
Status: reopened | Milestone:
Component: django.contrib.comments | Version: 1.1
Resolution: | Keywords: comments
inheritance moderation
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
----------------------------------------------+-----------------------------
Changes (by philgyford):
* status: closed => reopened
* resolution: invalid =>
Comment:
I think there's something up here. I've created a testcase that's as
simple as I can make it to demonstrate the situation I've come across that
seems to cause this error.
This project is an extremely simple weblog, with comments that are
extended from django.contrib.comments: http://github.com/philgyford
/django-commentstest/
As it is, the moderation works fine - if enable_comments on an Entry is
set to false, then posting a comment is prevented.
But if you add "from weblog.models import Entry" to either
customcomments/forms.py or customcomments/models.py, then moderation is
ignored, and comments can always be posted. (Why would you add this?
Because you might want to extend the comment class to use something from
the Entry model.)
Checking what's happening in django/contrib/comments/__init__.py's
get_model() function, in the first case it's returning a CommentWithTitle
class. But in the second case, when moderation isn't working, it's
returning a standard Comment class.
I'm too new to Django to know how to proceed with this, and whether this
really is a bug or it's something I've done, but after a couple of days of
poking at this (and posting to django-users today), I'm stumped.
--
Ticket URL: <http://code.djangoproject.com/ticket/12812#comment:7>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.