Merge lp:~replaceafill/launchpad/bug-125377 into lp:launchpad

Proposed by Douglas Cerna
Status: Merged
Merged at revision: 16911
Proposed branch: lp:~replaceafill/launchpad/bug-125377
Merge into: lp:launchpad
Diff against target: 32 lines (+11/-0)
2 files modified
lib/lp/blueprints/browser/specification.py (+5/-0)
lib/lp/blueprints/browser/tests/test_specification.py (+6/-0)
To merge this branch: bzr merge lp:~replaceafill/launchpad/bug-125377
Reviewer Review Type Date Requested Status
William Grant (community) code Approve
Review via email: mp+200444@code.launchpad.net

Description of the change

Set current user as the default drafter when registering a new blueprint

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) wrote :

Thanks, looks good.

As I mentioned in the other MP, before I can land this you'll need to sign the Canonical Contributor License Agreement. http://www.canonical.com/contributors has details and a link to the online form.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/blueprints/browser/specification.py'
--- lib/lp/blueprints/browser/specification.py 2013-04-10 08:09:05 +0000
+++ lib/lp/blueprints/browser/specification.py 2014-01-07 01:41:30 +0000
@@ -328,6 +328,11 @@
328 'this product')328 'this product')
329 self.setFieldError('information_type', error)329 self.setFieldError('information_type', error)
330330
331 def setUpWidgets(self):
332 super(NewSpecificationView, self).setUpWidgets()
333 widget = self.widgets['drafter']
334 widget.setRenderedValue(self.user)
335
331336
332class NewSpecificationFromTargetView(NewSpecificationView):337class NewSpecificationFromTargetView(NewSpecificationView):
333 """An abstract view for creating a specification from a target context.338 """An abstract view for creating a specification from a target context.
334339
=== modified file 'lib/lp/blueprints/browser/tests/test_specification.py'
--- lib/lp/blueprints/browser/tests/test_specification.py 2013-02-07 06:10:38 +0000
+++ lib/lp/blueprints/browser/tests/test_specification.py 2014-01-07 01:41:30 +0000
@@ -404,6 +404,12 @@
404 self.assertEqual(404 self.assertEqual(
405 InformationType.PUBLIC, view.initial_values['information_type'])405 InformationType.PUBLIC, view.initial_values['information_type'])
406406
407 def test_default_drafter_is_user(self):
408 drafter = self.factory.makePerson()
409 with person_logged_in(drafter):
410 view = self.createInitializedView()
411 self.assertEqual(drafter, view.widgets['drafter']._getFormValue())
412
407413
408class TestNewSpecificationFromRootView(TestCaseWithFactory,414class TestNewSpecificationFromRootView(TestCaseWithFactory,
409 NewSpecificationTests):415 NewSpecificationTests):