Merge lp:~rockstar/launchpad/bug-589454 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 10972 | ||||
Proposed branch: | lp:~rockstar/launchpad/bug-589454 | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
56 lines (+29/-6) 2 files modified
lib/lp/code/browser/sourcepackagerecipe.py (+8/-6) lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+21/-0) |
||||
To merge this branch: | bzr merge lp:~rockstar/launchpad/bug-589454 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | Approve | ||
Review via email: mp+27012@code.launchpad.net |
Description of the change
This branch fixes bug #589454. The problem is that LaunchpadFormVi
Curtis suggested I do something like:
if len(data.errors):
return
I didn't like that solution, since it's not allowing for other validation that can and should also occur. The way I wrote it, if name isn't set, it shows validation errors, and if name is a duplicate, then it shows that error. This all happens without effecting other validation code.
We discussed a few style improvements on IRC: ecipeSource utility in a variable to avoid breaking the "if" line in an awkward way.
* Keeping the ISourcePackageR
* Double-quoting rather than single-quoting stirngs that may contain apostrophes.
* A single data.get('name') instead of separate existence check and retrieval.
Unfortunately there seems to be no easy way to ask the test browser for the error message associated with the "name" field, so we'll continue to find them by class and then use list indexing.