Merge lp:~dhillon-v10/launchpad/fix-bug-410331 into lp:launchpad/db-devel

Proposed by Vikram Dhillon on 2010-02-08
Status: Superseded
Proposed branch: lp:~dhillon-v10/launchpad/fix-bug-410331
Merge into: lp:launchpad/db-devel
Diff against target: 21 lines (+11/-0)
1 file modified
lib/lp/soyuz/browser/archive.py (+11/-0)
To merge this branch: bzr merge lp:~dhillon-v10/launchpad/fix-bug-410331
Reviewer Review Type Date Requested Status
Julian Edwards (community) code 2010-02-08 Resubmit on 2010-02-08
Review via email: mp+18817@code.launchpad.net

This proposal has been superseded by a proposal from 2010-02-20.

To post a comment you must log in.
Vikram Dhillon (dhillon-v10) wrote :

Adding a default display name in the file lib/lp/soyuz/browser/archive.py

Julian Edwards (julian-edwards) wrote :

Hi

Thanks for working on the fix!

There are quite a few problems with this branch, I'll take you through what you need to change to get this branch accepted:

1. Remove the XXX line - we only add those if there's an outstanding issue. For regular bug fixes they're just irrelevant.
2. You've taken my suggested default too literally! We want to substitute the words in the displayname string and default to meaningful names.
3. The code you've written won't do anything for the first PPA activated, something that you'd have noticed if there were tests :)
4. There are no tests! You should examine the file at
lib/lp/soyuz/stories/ppa/xx-ppa-workflow.txt and particularly at around line 57 where it demonstrates that the name is pre-filled for the first PPA activated.

The logic for the pre-filled displayname should be something like:

If the name field has data in it:
    "PPA named <name> for <owner's name>"
else:
    "PPA for <owner's name>"

where <owner's name> is self.context.owner.displayname

Regards
Julian.

review: Resubmit (code)
Vikram Dhillon (dhillon-v10) wrote :

Julian, then something like this perhaps: (the spacing might not come out right)

if self.context.archive is not None:
         return { 'displayname' : "PPA named " + self.context.owner.name + "for " + self.context.owner.displayname}
else:
         return { 'displayname' : "PPA for " + self.context.owner.displayname}

Vikram Dhillon (dhillon-v10) wrote :

Or better yet, something like this:

if self.context.archive is not None:
         return { 'displayname' : "PPA named X for " + self.context.owner.displayname}
else:
         return { 'displayname' : "PPA for " + self.context.owner.displayname}

10287. By Vikram Dhillon on 2010-02-14

Removing the XXX line

10288. By Vikram Dhillon on 2010-02-14

New display name style for a ppa

10289. By Vikram Dhillon on 2010-03-14

Fixed the default ppa naming

Unmerged revisions

10289. By Vikram Dhillon on 2010-03-14

Fixed the default ppa naming

10288. By Vikram Dhillon on 2010-02-14

New display name style for a ppa

10287. By Vikram Dhillon on 2010-02-14

Removing the XXX line

10286. By Vikram Dhillon on 2010-02-08

Adding a default value to the display name when the ppa first activates.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/browser/archive.py'
2--- lib/lp/soyuz/browser/archive.py 2010-02-11 13:26:21 +0000
3+++ lib/lp/soyuz/browser/archive.py 2010-02-14 05:02:21 +0000
4@@ -1653,6 +1653,17 @@
5 # first PPA activation.
6 if self.context.archive is None:
7 return {'name': 'ppa'}
8+
9+ # Suggest a default value of "PPA name" the ppa name "for" their
10+ # name
11+ if self.context.archive is not None:
12+ return { 'displayname' : "PPA named " + self.context.archive.name +
13+ " for " + self.context.owner.displayname}
14+ # Or something like "PPA named X for " +
15+ # self.context.owner.displayname
16+ else:
17+ return { 'displayname' : "PPA for " + self.context.owner.displayname}
18+
19 return {}
20
21 def setUpFields(self):

Subscribers

People subscribed via source and target branches

to status/vote changes: