Skip to content

Commit 02454f7

Browse files
committed
remove specific mentor request block
1 parent 70499b3 commit 02454f7

3 files changed

Lines changed: 5 additions & 37 deletions

File tree

pybot/endpoints/slack/commands.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ def create_endpoints(plugin: SlackPlugin):
3434
async def slash_mentor(command: Command, app: SirBot):
3535
airtable = app.plugins["airtable"].api
3636
services = await airtable.get_all_records("Services", "Name")
37-
mentors = await airtable.get_all_records("Mentors", "Full Name")
3837
skillsets = await airtable.get_all_records("Skillsets", "Name")
3938

40-
blocks = mentor_request_blocks(services, mentors, skillsets)
39+
blocks = mentor_request_blocks(services, skillsets)
4140

4241
response = {
4342
"text": "Mentor Request Form",

pybot/endpoints/slack/message_templates/commands.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def ticket_dialog(clicker_email, text):
2020
}
2121

2222

23-
def mentor_request_blocks(services, mentors, skillsets):
23+
def mentor_request_blocks(services, skillsets):
2424
return [
2525
{
2626
"type": "section",
@@ -75,20 +75,6 @@ def mentor_request_blocks(services, mentors, skillsets):
7575
"value": "reset_skillsets",
7676
},
7777
},
78-
{
79-
"type": "section",
80-
"block_id": "mentor",
81-
"text": {"type": "mrkdwn", "text": "*Select a specific mentor* (optional)"},
82-
"accessory": {
83-
"type": "static_select",
84-
"action_id": "mentor_select",
85-
"placeholder": {"type": "plain_text", "text": "Mentor"},
86-
"options": [
87-
{"text": {"type": "plain_text", "text": mentor}, "value": mentor}
88-
for mentor in mentors
89-
],
90-
},
91-
},
9278
{
9379
"type": "section",
9480
"block_id": "comments",

pybot/endpoints/slack/message_templates/mentor_request.py

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ class BlockIndex(IntEnum):
1515
SERVICE = 2
1616
SKILLSET = 3
1717
SELECTED_SKILLSETS = 4
18-
MENTOR = 5
19-
COMMENTS = 6
20-
AFFILIATION = 7
21-
SUBMIT = 9
18+
COMMENTS = 5
19+
AFFILIATION = 6
20+
SUBMIT = 8
2221

2322

2423
class MentorRequest(BlockAction):
@@ -56,17 +55,6 @@ def add_skillset(self, skillset: str) -> None:
5655
new_field
5756
)
5857

59-
@property
60-
def mentor(self) -> Optional[str]:
61-
option = self.initial_option(BlockIndex.MENTOR)
62-
if option == "None":
63-
return None
64-
return option
65-
66-
@mentor.setter
67-
def mentor(self, new_mentor: str) -> None:
68-
self.blocks[BlockIndex.MENTOR]["accessory"]["initial_option"] = new_mentor
69-
7058
@property
7159
def details(self) -> str:
7260
block = self.blocks[BlockIndex.COMMENTS]
@@ -111,11 +99,6 @@ async def submit_request(self, username: str, email: str, airtable: AirtableAPI)
11199
params["Skillsets"] = self.skillsets
112100
if self.details:
113101
params["Additional Details"] = self.details
114-
if self.mentor:
115-
mentor_records = await airtable.find_records(
116-
"Mentors", "Full Name", self.mentor
117-
)
118-
params["Mentor Requested"] = [mentor_records[0]["id"]]
119102

120103
service_records = await airtable.find_records("Services", "Name", self.service)
121104
params["Service"] = [service_records[0]["id"]]

0 commit comments

Comments
 (0)