Move config options used by inspector to the constructor

This commit is contained in:
Turtle
2019-12-23 22:40:33 -05:00
parent 7aa74d5953
commit c22bf220f0
5 changed files with 21 additions and 27 deletions

View File

@@ -17,8 +17,9 @@ logger = Logger("API")
class API:
def __init__(self, watcher):
def __init__(self, watcher, config):
self.watcher = watcher
self.config = config
def add_appointment(self):
"""
@@ -41,7 +42,7 @@ class API:
# Check content type once if properly defined
request_data = json.loads(request.get_json())
inspector = Inspector()
inspector = Inspector(self.config)
appointment = inspector.inspect(
request_data.get("appointment"), request_data.get("signature"), request_data.get("public_key")
)