From 2eee79883f10ec1dcb31780808a4c67a7c845b2b Mon Sep 17 00:00:00 2001 From: Karl Czajkowski Date: Mon, 18 Apr 2016 21:07:12 -0700 Subject: [PATCH] fix logging when anonymous clients are allowed --- hatrac/rest/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hatrac/rest/core.py b/hatrac/rest/core.py index 70464a5..09d072a 100644 --- a/hatrac/rest/core.py +++ b/hatrac/rest/core.py @@ -79,7 +79,7 @@ def log_parts(): """Generate a dictionary of interpolation keys used by our logging template.""" now = datetime.datetime.now(pytz.timezone('UTC')) elapsed = (now - web.ctx.hatrac_start_time) - client_identity = web.ctx.webauthn2_context.client if web.ctx.webauthn2_context else '' + client_identity = web.ctx.webauthn2_context.client if web.ctx.webauthn2_context and web.ctx.webauthn2_context.client else '' if type(client_identity) is dict: client_identity = json.dumps(client_identity, separators=(',',':')) parts = dict(