← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/p3a-email-description-cleanup into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/p3a-email-description-cleanup into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #691018 Private PPA access granted emails say the description is "None" when there's no description
  https://bugs.launchpad.net/bugs/691018


Fix the new subscription to a P3A e-mail generated by Launchpad when the P3A has no description set to not include "and has the following description:", which is ... misleading and amateurish.
-- 
https://code.launchpad.net/~stevenk/launchpad/p3a-email-description-cleanup/+merge/43882
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/p3a-email-description-cleanup into lp:launchpad.
=== modified file 'lib/canonical/launchpad/emailtemplates/ppa-subscription-new.txt'
--- lib/canonical/launchpad/emailtemplates/ppa-subscription-new.txt	2010-02-11 14:04:16 +0000
+++ lib/canonical/launchpad/emailtemplates/ppa-subscription-new.txt	2010-12-16 11:13:55 +0000
@@ -3,9 +3,7 @@
 Launchpad: access to a private archive
 --------------------------------------
 
-%(registrant_name)s has granted you access to a private software archive "%(ppa_displayname)s" (%(ppa_reference)s), which is hosted by Launchpad and has the following description:
-
-%(ppa_description)s
+%(registrant_name)s has granted you access to a private software archive "%(ppa_displayname)s" (%(ppa_reference)s), which is hosted by Launchpad%(ppa_description_blurb)s
 
 To start downloading and using software from this archive you need to view your access details by visiting this link:
 

=== modified file 'lib/canonical/launchpad/mailnotification.py'
--- lib/canonical/launchpad/mailnotification.py	2010-11-08 13:11:30 +0000
+++ lib/canonical/launchpad/mailnotification.py	2010-12-16 11:13:55 +0000
@@ -562,13 +562,17 @@
         to_address = [person.preferredemail.email]
         recipient_subscriptions_url = "%s/+archivesubscriptions" % (
             canonical_url(person))
+        description_blurb = '.'
+        if ppa_description:
+            description_blurb = ' and has the following description:\n%s' % (
+                ppa_description)
         replacements = {
             'recipient_name': person.displayname,
             'registrant_name': registrant_name,
             'registrant_profile_url': canonical_url(subscription.registrant),
             'ppa_displayname': ppa_displayname,
             'ppa_reference': ppa_reference,
-            'ppa_description': ppa_description,
+            'ppa_description_blurb': description_blurb,
             'recipient_subscriptions_url': recipient_subscriptions_url,
             }
         body = MailWrapper(72).format(template % replacements,

=== modified file 'lib/lp/soyuz/doc/archivesubscriber.txt'
--- lib/lp/soyuz/doc/archivesubscriber.txt	2010-08-23 17:26:42 +0000
+++ lib/lp/soyuz/doc/archivesubscriber.txt	2010-12-16 11:13:55 +0000
@@ -19,6 +19,10 @@
     ...                               displayname="John Smith",
     ...                               password="test",
     ...                               email="john@xxxxxxxxxxx")
+    >>> fredsmith = factory.makePerson(name="fredsmith",
+    ...                               displayname="Fred Smith",
+    ...                               password="test",
+    ...                               email="fred@xxxxxxxxxxx")
     >>> from lp.registry.interfaces.person import IPersonSet
     >>> cprov = getUtility(IPersonSet).getByName("cprov")
     >>> no_priv = getUtility(IPersonSet).getByName("no-priv")
@@ -142,6 +146,41 @@
     The Launchpad team
     ----------------------------------------
 
+If the description of the P3A is changed to None, and a new user subscribed
+the e-mail does not contain the description.
+
+    >>> cprov_private_ppa.description = None
+    >>> unused = cprov_private_ppa.newSubscription(fredsmith, cprov)
+    >>> print_emails(include_reply_to=True)
+    From: Celso Providelo <noreply@xxxxxxxxxxxxx>
+    To: fred@xxxxxxxxxxx
+    Reply-To: Celso Providelo <celso.providelo@xxxxxxxxxxxxx>
+    Subject: PPA access granted for PPA named p3a for Celso Providelo
+    Hello Fred Smith,
+    <BLANKLINE>
+    Launchpad: access to a private archive
+    --------------------------------------
+    <BLANKLINE>
+    Celso Providelo has granted you access to a private software archive
+    "PPA named p3a for Celso Providelo" (ppa:cprov/p3a), which is hosted
+    by Launchpad.
+    <BLANKLINE>
+    To start downloading and using software from this archive you need to
+    view your access details by visiting this link:
+    <BLANKLINE>
+    <http://launchpad.dev/~fredsmith/+archivesubscriptions>
+    <BLANKLINE>
+    You can find out more about Celso Providelo here:
+    <BLANKLINE>
+    <http://launchpad.dev/~cprov>
+    <BLANKLINE>
+    If you'd prefer not to use software from this archive, you can safely
+    ignore this email. However, if you have any concerns you can contact the
+    Launchpad team by emailing feedback@xxxxxxxxxxxxx
+    <BLANKLINE>
+    Regards,
+    The Launchpad team
+    ----------------------------------------
 
 A subscription for a subscriber who already has a current subscription
 cannot be created:
@@ -226,7 +265,7 @@
     ...     new_sub.subscriber)[0].archive.displayname
     PPA named p3a for Celso Providelo
 
-    >>> print sub_set.getByArchive(new_sub.archive)[0].subscriber.name
+    >>> print sub_set.getByArchive(new_sub.archive)[1].subscriber.name
     joesmith
 
 The getBySubscriber() method takes an optional archive parameter for