~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Julian Edwards
  • Date: 2011-06-06 11:49:08 UTC
  • mfrom: (7675.1045.467 db-devel)
  • mto: This revision was merged to the branch mainline in revision 13205.
  • Revision ID: julian.edwards@canonical.com-20110606114908-30jm0009t79ewsad
merge db-devel, there are some test failures as a result

Show diffs side-by-side

added added

removed removed

Lines of Context:
275
275
                        'unsubscribe <a href="%s">%s</a> from this bug' % (
276
276
                            canonical_url(person),
277
277
                            cgi.escape(person.displayname))))
278
 
        if not self_subscribed and not is_really_muted:
279
 
            subscription_terms.insert(0,
280
 
                SimpleTerm(
281
 
                    self.user, self.user.name, 'subscribe me to this bug'))
 
278
        if not self_subscribed:
 
279
            if not is_really_muted:
 
280
                subscription_terms.insert(0,
 
281
                    SimpleTerm(
 
282
                        self.user, self.user.name,
 
283
                        'subscribe me to this bug'))
 
284
            elif not self.user_is_subscribed_directly:
 
285
                subscription_terms.insert(0,
 
286
                    SimpleTerm(
 
287
                        'update-subscription', 'update-subscription',
 
288
                        'unmute bug mail from this bug and subscribe me to '
 
289
                        'this bug'))
282
290
 
283
291
        # Add punctuation to the list of terms.
284
292
        if len(subscription_terms) > 1:
289
297
 
290
298
        subscription_vocabulary = SimpleVocabulary(subscription_terms)
291
299
        if (self._use_advanced_features and
292
 
            self.user_is_subscribed_directly):
 
300
            (self.user_is_subscribed_directly or self.user_is_muted)):
293
301
            default_subscription_value = self._update_subscription_term.value
294
302
        else:
295
303
            default_subscription_value = (
319
327
        if self._use_advanced_features:
320
328
            self.widgets['bug_notification_level'].widget_class = (
321
329
                'bug-notification-level-field')
322
 
            if self._subscriber_count_for_current_user == 0:
 
330
            if (len(self.form_fields['subscription'].field.vocabulary)==1):
323
331
                # We hide the subscription widget if the user isn't
324
332
                # subscribed, since we know who the subscriber is and we
325
333
                # don't need to present them with a single radio button.
330
338
                # subscribe theirself or unsubscribe their team.
331
339
                self.widgets['subscription'].visible = True
332
340
 
333
 
            if (self.user_is_subscribed_to_dupes_only or
334
 
                (self._use_advanced_features and self.user_is_muted and
335
 
                 not self.user_is_subscribed)):
 
341
            if self.user_is_subscribed_to_dupes_only:
336
342
                # If the user is subscribed via a duplicate but is not
337
343
                # directly subscribed, we hide the
338
344
                # bug_notification_level field, since it's not used.