From 27952e96e05cea4ce0f665c3ac78a49ced6defe9 Mon Sep 17 00:00:00 2001 From: imdadahad Date: Fri, 16 Dec 2016 12:41:19 +0000 Subject: [PATCH] Add comment for e.path schema validation fix Add comment for e.path in schema validation and use popleft() --- app/schema_validation/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/schema_validation/__init__.py b/app/schema_validation/__init__.py index 593e1b41a..bd94755d4 100644 --- a/app/schema_validation/__init__.py +++ b/app/schema_validation/__init__.py @@ -45,7 +45,9 @@ def __format_message(e): def get_path(e): error_path = None try: - error_path = e.path[0] + error_path = e.path.popleft() + # no need to catch IndexError exception explicity as + # error_path is None if e.path has no items finally: return error_path