Merge lp:~jelmer/launchpad/no-code-import-approval-2 into lp:launchpad

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: 13828
Proposed branch: lp:~jelmer/launchpad/no-code-import-approval-2
Merge into: lp:launchpad
Diff against target: 63 lines (+4/-27)
3 files modified
lib/lp/code/browser/codeimport.py (+1/-23)
lib/lp/code/interfaces/codeimport.py (+2/-3)
lib/lp/code/model/codeimport.py (+1/-1)
To merge this branch: bzr merge lp:~jelmer/launchpad/no-code-import-approval-2
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+73388@code.launchpad.net

Commit message

[r=gmb][bug=524303] Remove admin button for creating approved imports, and clarify notification about new imports requiring approval.

Description of the change

Two trivial fixes related to code import approvals:

 * Fix an incorrect message about code imports - they're now all automatically approved.
 * Remove the "Create Approved Import" button from the new import page, as it no longer is any different from the "Request Import" button

There didn't appear to be any tests related to either of these.

To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/browser/codeimport.py'
2--- lib/lp/code/browser/codeimport.py 2011-05-27 21:12:25 +0000
3+++ lib/lp/code/browser/codeimport.py 2011-08-30 16:58:05 +0000
4@@ -424,29 +424,7 @@
5 self.next_url = canonical_url(code_import.branch)
6
7 self.request.response.addNotification("""
8- New code import created. The code import operators
9- have been notified and the request will be reviewed shortly.""")
10-
11- def _showApprove(self, ignored):
12- """Is the user an admin or member of vcs-imports?"""
13- return self._super_user
14-
15- @action(_('Create Approved Import'), name='approve',
16- condition=_showApprove)
17- def approve_action(self, action, data):
18- """Create the code_import, and subscribe the user to the branch."""
19- try:
20- code_import = self._create_import(
21- data, CodeImportReviewStatus.REVIEWED)
22- except BranchExists, e:
23- self._setBranchExists(e.existing_branch)
24- return
25-
26- # Don't subscribe the requester as they are an import operator.
27- self.next_url = canonical_url(code_import.branch)
28-
29- self.request.response.addNotification(
30- "New reviewed code import created.")
31+ New code import created. The code import will start shortly.""")
32
33 def getProduct(self, data):
34 """If the context is a product, use that, otherwise get from data."""
35
36=== modified file 'lib/lp/code/interfaces/codeimport.py'
37--- lib/lp/code/interfaces/codeimport.py 2011-02-23 20:26:53 +0000
38+++ lib/lp/code/interfaces/codeimport.py 2011-08-30 16:58:05 +0000
39@@ -108,9 +108,8 @@
40 review_status = exported(
41 Choice(
42 title=_("Review Status"), vocabulary=CodeImportReviewStatus,
43- default=CodeImportReviewStatus.NEW, readonly=True,
44- description=_("Before a code import is performed, it is reviewed."
45- " Only reviewed imports are processed.")))
46+ default=CodeImportReviewStatus.REVIEWED, readonly=True,
47+ description=_("Only reviewed imports are processed.")))
48
49 rcs_type = exported(
50 Choice(title=_("Type of RCS"), readonly=True,
51
52=== modified file 'lib/lp/code/model/codeimport.py'
53--- lib/lp/code/model/codeimport.py 2011-08-30 00:09:33 +0000
54+++ lib/lp/code/model/codeimport.py 2011-08-30 16:58:05 +0000
55@@ -86,7 +86,7 @@
56 storm_validator=validate_public_person, notNull=False, default=None)
57
58 review_status = EnumCol(schema=CodeImportReviewStatus, notNull=True,
59- default=CodeImportReviewStatus.NEW)
60+ default=CodeImportReviewStatus.REVIEWED)
61
62 rcs_type = EnumCol(schema=RevisionControlSystems,
63 notNull=False, default=None)