Skip to content

Commit

Permalink
Merge pull request #63 from yobnoj/master
Browse files Browse the repository at this point in the history
Capitalization of entity-type json key for PortfolioItem get requests
  • Loading branch information
klehman-rally committed Nov 20, 2016
2 parents 14ec865 + 234650e commit 9e788c8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pyral/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ def __getattr__(self, name):
raise Exception('Unsupported attempt to retrieve context attribute')

rallyEntityTypeName = self.__class__.__name__
entity_path, oid = self._ref.split(SLM_WS_VER)[-1].rsplit('/', 1)
if entity_path.startswith('portfolioitem/'):
rallyEntityTypeName = entity_path.split('/')[-1].capitalize()
PORTFOLIO_PREFIX = 'PortfolioItem_'
if rallyEntityTypeName.startswith(PORTFOLIO_PREFIX):
rallyEntityTypeName = re.sub(PORTFOLIO_PREFIX, '',
rallyEntityTypeName)

faultTrigger = "getattr fault detected on %s instance for attribute: %s (hydrated? %s)" % \
(rallyEntityTypeName, name, self._hydrated)
Expand Down

0 comments on commit 9e788c8

Please sign in to comment.