← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~jugmac00/launchpad:update-webservice-api-for-iperson.createppa into launchpad:master

 

jugmac00 has proposed merging ~jugmac00/launchpad:update-webservice-api-for-iperson.createppa into launchpad:master.

Commit message:
Update webservice API for IPerson.createPPA

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jugmac00/launchpad/+git/launchpad/+merge/409991
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~jugmac00/launchpad:update-webservice-api-for-iperson.createppa into launchpad:master.
diff --git a/lib/lp/registry/interfaces/person.py b/lib/lp/registry/interfaces/person.py
index febfb57..3610054 100644
--- a/lib/lp/registry/interfaces/person.py
+++ b/lib/lp/registry/interfaces/person.py
@@ -1742,7 +1742,7 @@ class IPersonEditRestricted(Interface):
         distribution=Reference(schema=Interface, required=False),
         name=TextLine(required=True, constraint=name_validator),
         displayname=TextLine(required=False),
-        description=TextLine(required=False),
+        description=Text(required=False),
         private=Bool(required=False),
         suppress_subscription_notifications=Bool(required=False),
         )
diff --git a/lib/lp/soyuz/tests/test_person_createppa.py b/lib/lp/soyuz/tests/test_person_createppa.py
index d3d9aff..cc0a00b 100644
--- a/lib/lp/soyuz/tests/test_person_createppa.py
+++ b/lib/lp/soyuz/tests/test_person_createppa.py
@@ -11,12 +11,15 @@ from lp.registry.enums import (
     )
 from lp.registry.errors import PPACreationError
 from lp.registry.interfaces.teammembership import TeamMembershipStatus
+from lp.services.webapp.interfaces import OAuthPermission
 from lp.testing import (
+    api_url,
     celebrity_logged_in,
     person_logged_in,
     TestCaseWithFactory,
     )
 from lp.testing.layers import DatabaseFunctionalLayer
+from lp.testing.pages import webservice_for_person
 
 
 class TestCreatePPA(TestCaseWithFactory):
@@ -68,3 +71,18 @@ class TestCreatePPA(TestCaseWithFactory):
             ppa = private_team.createPPA(private=True)
             self.assertEqual(True, ppa.private)
             self.assertEqual(20480, ppa.authorized_size)
+
+    def test_webservice_accepts_multiline_description(self):
+        user = self.factory.makePerson()
+        endpoint = api_url(user)
+        webservice = webservice_for_person(
+            user,
+            permission=OAuthPermission.WRITE_PUBLIC,
+            default_api_version='devel'
+        )
+
+        response = webservice.named_post(
+            endpoint, 'createPPA', description='a\nb'
+        )
+
+        self.assertEqual(201, response.status)