Skip to content

Commit 8bd8100

Browse files
committed
better formatting
1 parent 28a96b1 commit 8bd8100

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

lung_cancer_screening/questions/management/commands/request_summary.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,36 @@ def handle(self, *args, **options):
2626
logger.warning("SLACK_WEBHOOK_URL is not set; skipping Slack notification.")
2727
return
2828

29+
# payload = {
30+
31+
32+
# "text": f"*Request summary*\n{rs.get_submitted_count()}/{rs.get_count()} (submitted/total)"
33+
# }
34+
2935
payload = {
30-
"text": f"*Request summary*\n{rs.get_submitted_count()}/{rs.get_count()} (submitted/total)"
31-
}
36+
"blocks": [
37+
{
38+
"type": "header",
39+
"text": {
40+
"type": "plain_text",
41+
"text": "Request Summary",
42+
}
43+
},
44+
{
45+
"type": "section",
46+
"fields": [
47+
{
48+
"type": "mrkdwn",
49+
"text": "*Requests:*\n{rs.get_count()}"
50+
},
51+
{
52+
"type": "mrkdwn",
53+
"text": "*Submitted:*\n{rs.get_submitted_count()}"
54+
}
55+
]
56+
}
57+
]
58+
}
3259

3360
response = requests.post(
3461
slack_webhook_url,

0 commit comments

Comments
 (0)