diff mbox series

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

Message ID 20180104154341.21555-1-stephen@that.guru
State Accepted
Headers show
Series [v2] parser: Log when invalid project list-id passed | expand

Commit Message

Stephen Finucane Jan. 4, 2018, 3:43 p.m. UTC
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@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(-)

Comments

Stephen Finucane Jan. 9, 2018, 11:59 p.m. UTC | #1
On Thu, 2018-01-04 at 15:43 +0000, Stephen Finucane wrote:
> 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@that.guru>

Applied.
diff mbox series

Patch

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