From: Carl Worth Date: Tue, 13 Oct 2020 20:57:52 +0000 (-0700) Subject: Add a "new_hunt" name to the button we place on the app's home view X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=b53e61e27241ce6a44811e72c85c996f51b9fbb9;p=turbot Add a "new_hunt" name to the button we place on the app's home view This will be more reliable to match on than any particular label text. --- diff --git a/turbot/views.py b/turbot/views.py index 122d92c..c7c8ac7 100644 --- a/turbot/views.py +++ b/turbot/views.py @@ -18,14 +18,15 @@ def actions(*elements): "elements": list(elements) } -def button(label): +def button(label, name): return { "type": "button", "text": { "type": "plain_text", "text": label, "emoji": True - } + }, + "value": name } def home(user_id, body): @@ -39,6 +40,6 @@ def home(user_id, body): "type": "home", "blocks": [ section(text("This is (or soon will be) a list of available puzzle hunts)")), - actions(button("New hunt")) + actions(button("New hunt", "new_hunt")) ] }