Show
Ignore:
Timestamp:
03/03/09 15:32:56 (17 months ago)
Author:
JensDiemer
Message:

blog: change the check referer mode values, add more unittests

Location:
trunk/pylucid_project/PyLucid/plugins_internal/blog
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid_project/PyLucid/plugins_internal/blog/blog.py

    r1837 r1838  
    593593            # We should it rejected as spam 
    594594            raise RejectSpam(msg) 
    595         elif check_referer == MODERATED: 
     595        else: 
    596596            # We should moderate the comment 
    597597            raise ModerateSubmit(msg) 
    598         else: 
    599             # Should never appear 
    600             raise AttributeError("Wrong check_referer value?!?") 
    601598 
    602599    def _delete_comment(self, comment_entry): 
  • trunk/pylucid_project/PyLucid/plugins_internal/blog/blog_cfg.py

    r1832 r1838  
    1919from PyLucid.models import Page 
    2020 
    21 DONT_CHECK = 0 
    22 REJECT_SPAM = 1 
    23 MODERATED = 2 
    24  
    25 ACTIONS = ( 
     21 
     22DONT_CHECK  = u"D" 
     23REJECT_SPAM = u"R" 
     24MODERATED   = u"M" 
     25 
     26CHECK_REFERER_CHOICES = ( 
    2627    (DONT_CHECK,    _("don't check")), 
    2728    (REJECT_SPAM,   _("reject as spam")), 
     
    2930) 
    3031 
     32 
    3133class PreferencesForm(forms.Form): 
    3234    """ 
     
    3739 
    3840    More information: http://www.pylucid.org/_goto/165/blog/ 
    39     """ 
     41    """     
    4042    blog_title = forms.CharField( 
    4143        initial = "blog", 
     
    142144 
    143145    check_referer = forms.ChoiceField( 
    144         choices = ACTIONS, 
     146        choices = CHECK_REFERER_CHOICES, 
    145147        initial = MODERATED, 
    146148        help_text = _(