Skip to content

Commit

Permalink
Merge pull request #65 from mystor/unavailable
Browse files Browse the repository at this point in the history
Notify user if reviewer is unavailable
  • Loading branch information
mystor authored Jul 27, 2019
2 parents 7a90001 + 35efcdb commit d2946a3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions phlay
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ class Reviewer(Cached):
# First, we try to locate a user with the reviewer's name.
self._info = conduit.search_one('user', {
'usernames': [self.tag]
})
}, attachments={'availability': True})
except UserError:
try:
# Then we locate a project based on its slug.
Expand Down Expand Up @@ -890,9 +890,14 @@ def process_args(args):
if reviewerinfo['phid'] not in rev_phids:
to_add.append(f"blocking({reviewerinfo['phid']})")
if reviewerinfo['type'] == 'USER':
label('Add Reviewer',
reviewerinfo['fields']['realName'],
f"[:{reviewerinfo['fields']['username']}]")
describe = reviewerinfo['fields']['realName'] + \
f" [:{reviewerinfo['fields']['username']}]"
label('Add Reviewer', describe)

availability = reviewerinfo['attachments']['availability']
if availability['value'] != 'available':
warn(commit, style.red(f"Reviewer {describe} Unavailable"))

elif reviewerinfo['type'] == 'PROJ':
label('Add Reviewer',
reviewerinfo['fields']['name'],
Expand Down

0 comments on commit d2946a3

Please sign in to comment.