Skip to content

Commit 0ac9013

Browse files
committed
Add new form link to the /mentor-volunteer endpoint #230
1 parent 9acf030 commit 0ac9013

File tree

8 files changed

+15
-16
lines changed

8 files changed

+15
-16
lines changed

pybot/endpoints/airtable/message_templates/messages.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from typing import List
22

33

4-
def mentor_request_text(user_id, service, skillsets, affiliation, requested_mentor_message=None):
4+
def mentor_request_text(
5+
user_id, service, skillsets, affiliation, requested_mentor_message=None
6+
):
57
if not skillsets:
68
skillsets = "None provided"
79
text = (
@@ -30,7 +32,7 @@ def claim_mentee_attachment(record: str) -> List[dict]:
3032
"text": "Claim Mentee",
3133
"type": "button",
3234
"style": "primary",
33-
"value": f"mentee_claimed",
35+
"value": "mentee_claimed",
3436
}
3537
],
3638
}

pybot/endpoints/airtable/utils.py

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

pybot/endpoints/api/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from slack.io.abc import SlackAPI
77
from slack.methods import Methods
88

9-
from pybot.endpoints.slack.utils import PYBOT_ENV, OPS_CHANNEL
9+
from pybot.endpoints.slack.utils import OPS_CHANNEL, PYBOT_ENV
1010
from pybot.endpoints.slack.utils.action_messages import (
1111
TICKET_OPTIONS,
1212
not_claimed_attachment,

pybot/endpoints/slack/commands.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,16 @@ async def slash_mentor(command: Command, app: SirBot):
4848

4949
@catch_command_slack_error
5050
async def slash_mentor_volunteer(command: Command, app: SirBot) -> None:
51-
airtable = app.plugins["airtable"].api
52-
skillsets = await airtable.get_all_records("Skillsets", "Name")
5351

54-
blocks = mentor_volunteer_blocks(skillsets)
5552
response = {
56-
"text": "Mentor Sign up Form",
57-
"blocks": blocks,
53+
"text": "Please fill up the Mentor Sign up Form here: https://op.co.de/volunteer-signup",
5854
"channel": command["user_id"],
5955
"as_user": True,
6056
}
6157

6258
await app.plugins["slack"].api.query(methods.CHAT_POST_MESSAGE, response)
6359

60+
6461
@catch_command_slack_error
6562
async def slash_report(command: Command, app: SirBot):
6663
"""

pybot/endpoints/slack/message_templates/mentor_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def mentee_claimed_attachment(self) -> dict:
245245
"actions": [
246246
{
247247
"name": f"{self.record}",
248-
"text": f"Reset claim",
248+
"text": "Reset claim",
249249
"type": "button",
250250
"style": "danger",
251251
"value": "reset_claim_mentee",

pybot/endpoints/slack/utils/action_messages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def greeted_attachment(user_id: str) -> List[dict]:
103103
"actions": [
104104
{
105105
"name": "reset_greet",
106-
"text": f"Reset claim",
106+
"text": "Reset claim",
107107
"type": "button",
108108
"style": "danger",
109109
"value": "reset_greet",
@@ -165,7 +165,7 @@ def claimed_attachment(user_id):
165165
"actions": [
166166
{
167167
"name": "reset_claim",
168-
"text": f"Reset claim",
168+
"text": "Reset claim",
169169
"type": "button",
170170
"style": "danger",
171171
"value": "reset_claim",

pybot/endpoints/slack/utils/slash_lunch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class LunchCommand:
1313
DEFAULT_LUNCH_DISTANCE = 20
1414
MIN_LUNCH_RANGE = 1
15-
AUTH_HEADER = {f"Authorization": f"Bearer {YELP_TOKEN}"}
15+
AUTH_HEADER = {"Authorization": f"Bearer {YELP_TOKEN}"}
1616

1717
def __init__(self, channel: str, user: str, input_text: str, user_name: str):
1818

pybot/plugins/airtable/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ def __init__(self, session, api_key, base_key):
1616
self.base_key = base_key
1717

1818
async def get(self, url, **kwargs):
19-
auth_header = {f"Authorization": f"Bearer {self.api_key}"}
19+
auth_header = {"Authorization": f"Bearer {self.api_key}"}
2020

2121
async with self.session.get(url, headers=auth_header, **kwargs) as r:
2222
return await r.json()
2323

2424
async def patch(self, url, **kwargs):
25-
auth_header = {f"authorization": f"Bearer {self.api_key}"}
25+
auth_header = {"authorization": f"Bearer {self.api_key}"}
2626
async with self.session.patch(url, headers=auth_header, **kwargs) as r:
2727
r.raise_for_status()
2828
return await r.json()
2929

3030
async def post(self, url, **kwargs):
31-
auth_header = {f"authorization": f"Bearer {self.api_key}"}
31+
auth_header = {"authorization": f"Bearer {self.api_key}"}
3232
async with self.session.post(url, headers=auth_header, **kwargs) as r:
3333
return await r.json()
3434

0 commit comments

Comments
 (0)