IPerson.createPPA's only accepts a single line description on webservice

Bug #1650338 reported by Robert Bruce Park
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

Just saw this error calling createPPA() in lplib:

lazr.restfulclient.errors.BadRequest: HTTP Error 400: Bad Request
Response headers:
---
-content-encoding: gzip
connection: close
content-length: 60
content-type: text/plain;charset=utf-8
date: Thu, 15 Dec 2016 06:26:16 GMT
server: zope.server.http (HTTP)
status: 400
strict-transport-security: max-age=15552000
vary: Accept,Accept-Encoding
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-launchpad-revision: 18293
x-lazr-notifications: []
x-powered-by: Zope (www.zope.org), Python (www.python.org)
x-xss-protection: 1; mode=block
---
Response body:
---
b'description: https://bileto.staging.ubuntu.com/#/ticket/26\n\n'
---

Calling .strip() on the string passed to description fixes the issue. Would be nice if LP was more robust against whitespace in submitted values. Either preserving it without exploding, or if it really can't handle it for some reason, stripping it itself rather than exploding.

Tags: api ppa trivial
William Grant (wgrant)
summary: - launchpad explodes when given description with trailing newlines
+ IPerson.createPPA's only excepts a single line description on webservice
Changed in launchpad:
importance: Undecided → Low
Revision history for this message
William Grant (wgrant) wrote : Re: IPerson.createPPA's only excepts a single line description on webservice

IPerson.createPPA's description field is a TextLine, but it should be Text.

Ideally it would use copy_field, but registry shouldn't import soyuz.

tags: added: api ppa trivial
Colin Watson (cjwatson)
summary: - IPerson.createPPA's only excepts a single line description on webservice
+ IPerson.createPPA's only accepts a single line description on webservice
Changed in launchpad:
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.