﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
11917	Generic comment moderation fails on ./manage.py shell with AlreadyModerated	fractal	nobody	"when you register a model to be moderated you are unable o import that models.py on the shell


how to reproduce

create a project and a app inside it
set a model and a Comment moderator as per 
http://docs.djangoproject.com/en/dev/ref/contrib/comments/moderation/ instructions
{{{
#foo/bar/models.py
from django.db import models
class Entry(models.Model):
    pass

from django.contrib.comments.moderation import CommentModerator, moderator
class EntryModerator(CommentModerator):
    pass
moderator.register(Entry, EntryModerator)

}}}

save and open the shell


{{{
./manage shell
In [1]: from bar.models import *
---------------------------------------------------------------------------
AlreadyModerated                          Traceback (most recent call last)

/tmp/foo/<ipython console> in <module>()

/tmp/foo/bar/models.py in <module>()
      9 
     10 class EntryModerator(CommentModerator):
     11     pass
     12 
---> 13 moderator.register(Entry, EntryModerator)

/usr/local/lib/python2.6/dist-packages/django/contrib/comments/moderation.pyc in register(self, model_or_iterable, moderation_class)
    301         for model in model_or_iterable:
    302             if model in self._registry:
--> 303                 raise AlreadyModerated(""The model '%s' is already being moderated"" % model._meta.module_name)
    304             self._registry[model] = moderation_class(model)
    305 

AlreadyModerated: The model 'entry' is already being moderated


}}}

"	Uncategorized	closed	contrib.comments	1.1	Normal	worksforme	AlreadyModerated		Unreviewed	0	0	0	0	0	0
