~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to threadedcomments/moderation.py

  • Committer: franku
  • Date: 2016-12-13 18:28:51 UTC
  • mto: This revision was merged to the branch mainline in revision 443.
  • Revision ID: somal@arcor.de-20161213182851-bo5ebf8pdvw5beua
run the script

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
            return True
34
34
        return super(CommentModerator, self).moderate(comment, content_object)
35
35
 
 
36
 
36
37
class Moderator(moderation.Moderator):
 
38
 
37
39
    def connect(self):
38
40
        for model in (ThreadedComment, FreeThreadedComment):
39
41
            signals.pre_save.connect(self.pre_save_moderation, sender=model)
40
42
            signals.post_save.connect(self.post_save_moderation, sender=model)
41
 
    
42
 
    ## THE FOLLOWING ARE HACKS UNTIL django-comment-utils GETS UPDATED SIGNALS ####
 
43
 
 
44
    # THE FOLLOWING ARE HACKS UNTIL django-comment-utils GETS UPDATED SIGNALS
 
45
    # ####
43
46
    def pre_save_moderation(self, sender=None, instance=None, **kwargs):
44
47
        return super(Moderator, self).pre_save_moderation(sender, instance)
45
48
 
47
50
        return super(Moderator, self).post_save_moderation(sender, instance)
48
51
 
49
52
 
50
 
# Instantiate the ``Moderator`` so that other modules can import and 
 
53
# Instantiate the ``Moderator`` so that other modules can import and
51
54
# begin to register with it.
52
55
 
53
 
moderator = Moderator()
 
 
b'\\ No newline at end of file'
 
56
moderator = Moderator()