~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/browser/bugmessage.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-14 00:24:37 UTC
  • mfrom: (14460.1.2 whitespace-comments-198058)
  • Revision ID: launchpad@pqm.canonical.com-20111214002437-uxqo8g32duf8kapa
[r=bac][bug=198058] The bug:+Comments made up entirely of whitespace
        should be discarded

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
        # Ensure either a comment or filecontent was provide, but only
55
55
        # if no errors have already been noted.
56
56
        if len(self.errors) == 0:
57
 
            comment = data.get('comment', None)
 
57
            comment = data.get('comment') or u''
58
58
            filecontent = data.get('filecontent', None)
59
 
            if not comment and not filecontent:
 
59
            if not comment.strip() and not filecontent:
60
60
                self.addError("Either a comment or attachment "
61
61
                              "must be provided.")
62
62
 
135
135
            self.request.response.addNotification(
136
136
                "Attachment %s added to bug." % filename)
137
137
 
138
 
 
139
138
    def shouldShowEmailMeWidget(self):
140
139
        """Should the subscribe checkbox be shown?"""
141
140
        return not self.context.bug.isSubscribed(self.user)