From 77f286ca02c9e017ab304cef51e770f04f33b9ec Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 19 Oct 2012 15:30:42 -0400 Subject: [PATCH] [schema] Add a Client model keeping track of the sending client. (imported from commit 31a430b1de14ce973addafd5d13ace049a8f8091) --- common.py | 2 ++ zephyr_mirror.py | 1 + 2 files changed, 3 insertions(+) diff --git a/common.py b/common.py index b12baf2..5f55922 100644 --- a/common.py +++ b/common.py @@ -18,6 +18,8 @@ class HumbugAPI(): def do_api_query(self, request, url): request["email"] = self.email request["api-key"] = self.api_key + if "client" not in request: + request["client"] = "API" while True: try: res = requests.post(urlparse.urljoin(self.base_url, url), data=request, verify=True) diff --git a/zephyr_mirror.py b/zephyr_mirror.py index 9bef50f..d47eda5 100755 --- a/zephyr_mirror.py +++ b/zephyr_mirror.py @@ -99,6 +99,7 @@ def send_humbug(zeph): elif isinstance(zeph[key], str): zeph[key] = zeph[key].decode("utf-8") + zeph['client'] = "zephyr_mirror" return humbug_client.send_message(zeph) def fetch_fullname(username):