#12325: [PATCH]Allow zero moderate_after time
----------------------------------------------+-----------------------------
          Reporter:  zhigang                  |         Owner:  nobody    
            Status:  new                      |     Milestone:            
         Component:  django.contrib.comments  |       Version:  1.1       
        Resolution:                           |      Keywords:  moderation
             Stage:  Accepted                 |     Has_patch:  1         
        Needs_docs:  0                        |   Needs_tests:  1         
Needs_better_patch:  0                        |  
----------------------------------------------+-----------------------------
Changes (by eternicode):

 * cc: [email protected] (added)

Comment:

 Where should tests for this patch go, and what approach should be used for
 them?

 The comments app currently doesn't have *any* tests, and I think this is
 understandable (not good, just understandable), because the various
 aspects of the app depend on subclassing (for custom moderation) and other
 models (for normal commenting).


 At any rate, an alternative workaround to using a negative number is to
 specify a very small number, such as one second:

 {{{
 class MyModerator(CommentModerator):
     auto_moderate_field = 'moderate_after'
     moderate_after = 1.0/86400 # 1 out of the 86,400 seconds in a day
 }}}

 Not as clean as "0", but it's effectively the same and will work until
 this patch is checked in.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12325#comment:2>
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.

Reply via email to