~abompard/mailman/moderation_reasons

« back to all changes in this revision

Viewing changes to src/mailman/rules/moderation.py

  • Committer: Aurelien Bompard
  • Date: 2014-04-17 20:16:14 UTC
  • Revision ID: abompard@redhat.com-20140417201614-lu003t6awfju7nfo
Use real reasons when a message is held

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
                # stored in the pending request table.
60
60
                msgdata['moderation_action'] = action.name
61
61
                msgdata['moderation_sender'] = sender
 
62
                if 'moderation_reasons' not in msgdata:
 
63
                    msgdata['moderation_reasons'] = []
 
64
                msgdata['moderation_reasons'].append(
 
65
                        _('The message comes from a moderated member'))
62
66
                return True
63
67
        # The sender is not a member so this rule does not match.
64
68
        return False
104
108
                # stored in the pending request table.
105
109
                msgdata['moderation_action'] = action.name
106
110
                msgdata['moderation_sender'] = sender
 
111
                if 'moderation_reasons' not in msgdata:
 
112
                    msgdata['moderation_reasons'] = []
 
113
                msgdata['moderation_reasons'].append(
 
114
                        _('The message is not from a list member'))
107
115
                return True
108
116
        # The sender must be a member, so this rule does not match.
109
117
        return False