launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #17758
[Merge] lp:~cjwatson/launchpad/oauth-projectgroup into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/oauth-projectgroup into lp:launchpad.
Commit message:
Rename IOAuthToken.project to IOAuthToken.projectgroup.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #523054 in Launchpad itself: "Rename Product.project to Product.projectgroup"
https://bugs.launchpad.net/launchpad/+bug/523054
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/oauth-projectgroup/+merge/247970
Rename IOAuthToken.project to IOAuthToken.projectgroup.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/oauth-projectgroup into lp:launchpad.
=== modified file 'lib/lp/services/oauth/interfaces.py'
--- lib/lp/services/oauth/interfaces.py 2014-09-01 03:45:08 +0000
+++ lib/lp/services/oauth/interfaces.py 2015-01-29 12:17:16 +0000
@@ -148,8 +148,8 @@
description=_('The key used to identify this token. It is included '
'by the consumer in each request.'))
product = Choice(title=_('Project'), required=False, vocabulary='Product')
- project = Choice(
- title=_('Project'), required=False, vocabulary='ProjectGroup')
+ projectgroup = Choice(
+ title=_('Project Group'), required=False, vocabulary='ProjectGroup')
sourcepackagename = Choice(
title=_("Package"), required=False, vocabulary='SourcePackageName')
distribution = Choice(
=== modified file 'lib/lp/services/oauth/model.py'
--- lib/lp/services/oauth/model.py 2014-09-02 01:23:41 +0000
+++ lib/lp/services/oauth/model.py 2015-01-29 12:17:16 +0000
@@ -197,7 +197,7 @@
product = ForeignKey(
dbName='product', foreignKey='Product', notNull=False, default=None)
- project = ForeignKey(
+ projectgroup = ForeignKey(
dbName='project', foreignKey='ProjectGroup', notNull=False,
default=None)
sourcepackagename = ForeignKey(
@@ -208,22 +208,22 @@
notNull=False, default=None)
def __init__(self, consumer, permission, key, secret='', person=None,
- date_expires=None, product=None, project=None,
+ date_expires=None, product=None, projectgroup=None,
distribution=None, sourcepackagename=None):
secret = hashlib.sha256(secret).hexdigest()
super(OAuthAccessToken, self).__init__(
consumer=consumer, permission=permission, key=key,
_secret=secret, person=person, date_expires=date_expires,
- product=product, project=project, distribution=distribution,
- sourcepackagename=sourcepackagename)
+ product=product, projectgroup=projectgroup,
+ distribution=distribution, sourcepackagename=sourcepackagename)
@property
def context(self):
"""See `IOAuthToken`."""
if self.product:
return self.product
- elif self.project:
- return self.project
+ elif self.projectgroup:
+ return self.projectgroup
elif self.distribution:
if self.sourcepackagename:
return self.distribution.getSourcePackage(
@@ -261,7 +261,7 @@
product = ForeignKey(
dbName='product', foreignKey='Product', notNull=False, default=None)
- project = ForeignKey(
+ projectgroup = ForeignKey(
dbName='project', foreignKey='ProjectGroup', notNull=False,
default=None)
sourcepackagename = ForeignKey(
@@ -272,22 +272,22 @@
notNull=False, default=None)
def __init__(self, consumer, key, secret='', permission=None, person=None,
- date_expires=None, product=None, project=None,
+ date_expires=None, product=None, projectgroup=None,
distribution=None, sourcepackagename=None):
secret = hashlib.sha256(secret).hexdigest()
super(OAuthRequestToken, self).__init__(
consumer=consumer, permission=permission, key=key,
_secret=secret, person=person, date_expires=date_expires,
- product=product, project=project, distribution=distribution,
- sourcepackagename=sourcepackagename)
+ product=product, projectgroup=projectgroup,
+ distribution=distribution, sourcepackagename=sourcepackagename)
@property
def context(self):
"""See `IOAuthToken`."""
if self.product:
return self.product
- elif self.project:
- return self.project
+ elif self.projectgroup:
+ return self.projectgroup
elif self.distribution:
if self.sourcepackagename:
return self.distribution.getSourcePackage(
@@ -323,7 +323,7 @@
if IProduct.providedBy(context):
self.product = context
elif IProjectGroup.providedBy(context):
- self.project = context
+ self.projectgroup = context
elif IDistribution.providedBy(context):
self.distribution = context
elif IDistributionSourcePackage.providedBy(context):
@@ -352,7 +352,7 @@
consumer=self.consumer, person=self.person, key=key,
secret=secret, permission=access_level,
date_expires=self.date_expires, product=self.product,
- project=self.project, distribution=self.distribution,
+ projectgroup=self.projectgroup, distribution=self.distribution,
sourcepackagename=self.sourcepackagename)
# We want to notify the user that this oauth token has been generated
=== modified file 'lib/lp/services/oauth/tests/test_tokens.py'
--- lib/lp/services/oauth/tests/test_tokens.py 2014-06-27 10:08:20 +0000
+++ lib/lp/services/oauth/tests/test_tokens.py 2015-01-29 12:17:16 +0000
@@ -223,9 +223,9 @@
self.factory.makeProduct)
self.assertEquals(token.context.name, name)
- def test_review_with_project_context(self):
+ def test_review_with_project_group_context(self):
# When reviewing a request token, the context may be set to a
- # project.
+ # project group.
token, name = self._reviewed_token_for_context(
self.factory.makeProject)
self.assertEquals(token.context.name, name)
Follow ups