bug title, bug summary fields can be made empty via the API

Bug #373370 reported by Celso Providelo
0
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

General required text fields can be set as empty string via the webservice API, however the same thing can't be done via the usual web UI forms.

This is a consistency problem and sometimes can also cause UI problem (lack of page title or main header).

We have overly weak validators on the involved model objects (and this is perhaps systemic - one way to fix would be to change the defaults for 'String(null=False)' to actually mean 'String(null=False, validator=lambda x:len(x) > 0)'

Changed in launchpad-foundations:
importance: Undecided → High
status: New → Triaged
Changed in lazr.restful:
importance: Undecided → High
status: New → Triaged
Curtis Hovey (sinzui)
tags: added: api
Revision history for this message
Robert Collins (lifeless) wrote :

This suggests broken model validators.

Revision history for this message
Robert Collins (lifeless) wrote :

So, definitely broken model validators. Lazr.restful cannot assume that all fields that require a value will reject ''. So This isn't a lazr.restful bug. It may be a bug that the default doesn't match what we use most often in LP however; a missing default is not IMNSHO high.

Changed in lazr.restful:
importance: High → Low
Revision history for this message
Robert Collins (lifeless) wrote :

For the LP side, we need to make this into separate bugs for the fields that are bogus. In fact, I'm going to narrow this bug down to just the known fields, and remove the restful task entirely.

no longer affects: lazr.restful
summary: - Text fields can be made empty via the API, but not via the web UI
+ page title, bug summary fields can be made empty via the API
description: updated
Changed in launchpad:
importance: High → Low
Revision history for this message
Curtis Hovey (sinzui) wrote : Re: page title, bug summary fields can be made empty via the API

Some aspects of this bug overlaps with bug 400477 where the fields are correct by lazr by-passes the normalisation/validation rules.

Curtis Hovey (sinzui)
summary: - page title, bug summary fields can be made empty via the API
+ bug title, bug summary fields can be made empty via the API
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.