[PATCH v2] parser: Log when invalid project list-id passed

Stephen Finucane stephen at that.guru
Fri Jan 5 02:43:41 AEDT 2018


I thought there was a bug. Turns out I was just using the wrong list-id.
Make this clearer.

Signed-off-by: Stephen Finucane <stephen at that.guru>
---
v2:
- Don't use 'error' level logging (aconole)
- Add a second log for fetching list-id from mail headers
---
 patchwork/parser.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/patchwork/parser.py b/patchwork/parser.py
index 1568bc44..05249df0 100644
--- a/patchwork/parser.py
+++ b/patchwork/parser.py
@@ -156,7 +156,7 @@ def find_project_by_id(list_id):
     try:
         project = Project.objects.get(listid=list_id)
     except Project.DoesNotExist:
-        pass
+        logger.debug("'%s' if not a valid project list-id", list_id)
     return project
 
 
@@ -185,6 +185,9 @@ def find_project_by_header(mail):
             if project:
                 break
 
+    if not project:
+        logger.debug("Could not find a list-id in mail headers", list_id)
+
     return project
 
 
-- 
2.14.3



More information about the Patchwork mailing list