Skip to content

Commit 2514d8c

Browse files
committed
new isContributor and areContributors functions for easier checking of logins belonging to contributors
1 parent ec1ed39 commit 2514d8c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/gitxray/include/gx_context.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ def getContributor(self):
6666
def getContributors(self):
6767
return self._contributors
6868

69+
def isContributor(self, contributor_login):
70+
return any(contributor.get('login') == contributor_login for contributor in self.getContributors())
71+
72+
def areContributors(self, contributors_logins):
73+
return any(contributor.get('login') in contributors_logins for contributor in self.getContributors())
74+
6975
# We also use our gitxray context to cross-reference identifiers.
7076
def linkIdentifier(self, identifierType, identifierValues, contributorLogin):
7177
for identifierValue in identifierValues:

0 commit comments

Comments
 (0)