Closed martinzugnoni closed 11 years ago
It would help to see your moderator.py and the auto_discover
in your urls.py file.
Also did you remember to add moderation to INSTALLED_APPS
?
from moderation import moderation from buscador.models import Linea moderation.register(Linea)
from django.conf.urls.defaults import patterns, include, url from django.contrib import admin from moderation.helpers import auto_discover
admin.autodiscover() auto_discover()
urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^buscador/', include('buscador.urls'),name='buscador'), )
INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles',
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'moderation',
)
Thanks!
Are you testing with non-staff users? GenericModerator
, the default moderation class, sets auto_approve_for_superusers
and auto_approve_for_staff
to True
by default.
If you don't like any of the default options I'd recommend creating your own moderator as an extension of GenericModerator
and changing the default options to suit your application.
@martinzugnoni Does above answer solves your problem ?
I'm having the same issue. Any resolution? I have tried the same as @martinzugnoni above to no avail.
I have also tried having the following in moderator.py but this doesn't work either:
from moderation import moderation from journals.outlets.models import Article
from moderation.moderator import GenericModerator
class ArticleModerator(GenericModerator): notify_user = False auto_approve_for_superusers = False auto_approve_for_staff = False
moderation.register(Article, ArticleModerator)
This works well for me, @gdsaxton. Did you remember to import your moderations somewhere (I do it in in my main urls.py, although this makes pyflakes complain about an unused import) so the moderator.register call actually gets executed?
from django.contrib.comments.moderation import CommentModerator, moderator from mydjangoapps.news.models import NewsItem
class NewsItemModerator(CommentModerator): email_notification = True moderate_after = 0 # always require approval close_after = 365 auto_moderate_field = 'published' auto_close_field = 'published' enable_field = 'enable_comments' moderator.register(NewsItem, NewsItemModerator)
[...] import moderations [...]
Thanks, @gazinyork -- let me give that a whirl and see if it works.
Hi everyone! I'm trying the django-moderation app in a web system, but I can not make it work. I have made all the steps that are explained in the documentation, but there is something wrong. There is no errors. But when I save a moderated Model, it is directly saved in the Model's table, and not in the moderatedobject table. I have correctly configurated the settings.py options. I have created the moderator.py file in my app's directory and putted there the registration code. I have imported and run the auto_discover script. But nothing happens. Can someone help me? Thank you so much!
Martin.-