Skip to content

Commit 9acf030

Browse files
author
Aaron Suarez
authored
Merge pull request #168 from chynh/mentor-command-fix
Require comments and add "non veteran" option in mentor request form
2 parents 475d7d3 + 33e328e commit 9acf030

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

pybot/endpoints/airtable/message_templates/messages.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
from typing import List
22

33

4-
def mentor_request_text(user_id, service, skillsets, requested_mentor_message=None):
4+
def mentor_request_text(user_id, service, skillsets, affiliation, requested_mentor_message=None):
55
if not skillsets:
66
skillsets = "None provided"
77
text = (
88
f"User <@{user_id}> has requested a mentor for {service}\n\n"
9-
f"Requested Skillset(s): {skillsets.replace(',', ', ')}"
9+
f"Requested Skillset(s): {skillsets.replace(',', ', ')}\n\n"
10+
f"Requestor Affiliation: {affiliation}"
1011
)
1112

1213
if requested_mentor_message:

pybot/endpoints/airtable/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def _create_messages(
6565
slack_id,
6666
service_translation,
6767
request.get("skillsets", None),
68+
request.get('affiliation', 'None Provided'),
6869
requested_mentor_message,
6970
),
7071
"attachments": claim_mentee_attachment(request["record"]),

pybot/endpoints/slack/message_templates/commands.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def mentor_request_blocks(services, skillsets):
7878
{
7979
"type": "section",
8080
"block_id": "comments",
81-
"text": {"type": "mrkdwn", "text": "*Add additional comments* (optional)"},
81+
"text": {"type": "mrkdwn", "text": "*Add comments* (required)"},
8282
"accessory": {
8383
"type": "button",
8484
"action_id": "comments_btn",
@@ -111,6 +111,10 @@ def mentor_request_blocks(services, skillsets):
111111
"text": {"type": "plain_text", "text": "Military Spouse"},
112112
"value": "Military Spouse",
113113
},
114+
{
115+
"text": {"type": "plain_text", "text": "Non Veteran"},
116+
"value": "Non Veteran",
117+
},
114118
],
115119
},
116120
},

pybot/endpoints/slack/message_templates/mentor_request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ def affiliation(self, new_affiliation: str) -> None:
8181
self.clear_errors()
8282

8383
def validate_self(self) -> bool:
84-
if not self.service or not self.affiliation:
84+
if not self.service or not self.affiliation or not self.details:
8585
return False
8686
self.clear_errors()
8787
return True
8888

8989
def add_errors(self) -> None:
9090
submit_attachment = {
91-
"text": ":warning: Service and group certification are required. :warning:",
91+
"text": ":warning: Service, group certification and comments are required. :warning:",
9292
"color": "danger",
9393
}
9494
self.attachments = [submit_attachment]

0 commit comments

Comments
 (0)