Skip to content

Commit 20d43e5

Browse files
committed
add None option to mentor request
1 parent 0d45a2d commit 20d43e5

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

pybot/endpoints/slack/message_templates/commands.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ def mentor_request_attachments(services, mentors, skillsets):
6262
'fallback': 'Mentor Request',
6363
'actions': [{
6464
'type': 'select', 'text': 'Specific Mentor', 'name': 'mentor',
65-
'options': [{'text': mentor, 'value': mentor} for mentor in mentors]
65+
'options': [
66+
{'text': 'None', 'value': 'None'},
67+
*[{'text': mentor, 'value': mentor} for mentor in mentors],
68+
]
6669
}]
6770
},
6871
{

pybot/endpoints/slack/message_templates/mentor_request.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ def add_skillset(self, skillset: str) -> None:
7373
self.attachments[AttachmentIndex.SKILLSET]['text'] = '\n'.join(skills)
7474

7575
@property
76-
def mentor(self) -> str:
76+
def mentor(self) -> Optional[str]:
7777
attachment = self.attachments[AttachmentIndex.MENTOR]
78-
return self.selected_option(attachment)
78+
option = self.selected_option(attachment)
79+
return None if option == 'None' else option
7980

8081
@mentor.setter
8182
def mentor(self, new_mentor: str) -> None:

0 commit comments

Comments
 (0)