webhooks: Eliminate the usage of a headers.py file.

For storing HTTP headers as a function of fixture name, previously
we required that the fixture_to_headers method should reside in a
separate module called headers.py.

However, as in many cases, this method will only take a few lines,
we decided to move this function into the view.py file of the
integration instead of requiring a whole new file called headers.py

This commit introduces the small change in the system architecture,
migrates the GitHub integration, and updates the docs accordingly.
This commit is contained in:
Hemanth V. Alluri
2019-06-22 10:27:40 +05:30
committed by Tim Abbott
parent 4691028097
commit ef52aa0fc1
5 changed files with 31 additions and 33 deletions

View File

@@ -16,6 +16,10 @@ from zerver.lib.webhooks.git import CONTENT_MESSAGE_TEMPLATE, \
get_pull_request_event_message, get_push_commits_event_message, \
get_push_tag_event_message, get_setup_webhook_message
from zerver.models import UserProfile
from zerver.lib.webhooks.common import \
get_http_headers_from_filename
fixture_to_headers = get_http_headers_from_filename("HTTP_X_GITHUB_EVENT")
class UnknownEventType(Exception):
pass