webhooks: Rename *topic local variables to *topic_name.

This is preparatory work towards adding a Topic model.
We plan to use the local variable name as 'topic' for
the Topic model objects.

Currently, we use *topic as the local variable name for
topic names.

We rename local variables of the form *topic to *topic_name
so that we don't need to think about type collisions in
individual code paths where we might want to talk about both
Topic objects and strings for the topic name.
This commit is contained in:
Prakhar Pratyush
2024-01-17 20:23:30 +05:30
committed by Tim Abbott
parent 030f899195
commit 3afc8ed7ae
163 changed files with 1725 additions and 1619 deletions

View File

@@ -828,7 +828,7 @@ def api_github_webhook(
# for events that are valid but not yet handled by us.
# See IGNORED_EVENTS, for example.
return json_success(request)
topic = get_topic_based_on_type(payload, event)
topic_name = get_topic_based_on_type(payload, event)
body_function = EVENT_FUNCTION_MAPPER[event]
@@ -839,7 +839,7 @@ def api_github_webhook(
)
body = body_function(helper)
check_send_webhook_message(request, user_profile, topic, body, event)
check_send_webhook_message(request, user_profile, topic_name, body, event)
return json_success(request)