[schema] Add a Client model keeping track of the sending client.
(imported from commit 31a430b1de14ce973addafd5d13ace049a8f8091)
This commit is contained in:
parent
1ffc2c1cb7
commit
77f286ca02
|
@ -18,6 +18,8 @@ class HumbugAPI():
|
||||||
def do_api_query(self, request, url):
|
def do_api_query(self, request, url):
|
||||||
request["email"] = self.email
|
request["email"] = self.email
|
||||||
request["api-key"] = self.api_key
|
request["api-key"] = self.api_key
|
||||||
|
if "client" not in request:
|
||||||
|
request["client"] = "API"
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
res = requests.post(urlparse.urljoin(self.base_url, url), data=request, verify=True)
|
res = requests.post(urlparse.urljoin(self.base_url, url), data=request, verify=True)
|
||||||
|
|
|
@ -99,6 +99,7 @@ def send_humbug(zeph):
|
||||||
elif isinstance(zeph[key], str):
|
elif isinstance(zeph[key], str):
|
||||||
zeph[key] = zeph[key].decode("utf-8")
|
zeph[key] = zeph[key].decode("utf-8")
|
||||||
|
|
||||||
|
zeph['client'] = "zephyr_mirror"
|
||||||
return humbug_client.send_message(zeph)
|
return humbug_client.send_message(zeph)
|
||||||
|
|
||||||
def fetch_fullname(username):
|
def fetch_fullname(username):
|
||||||
|
|
Loading…
Reference in a new issue