]> git.ipfire.org Git - thirdparty/patchwork.git/commit
parser: Handle IntegrityError for cover letters, comments
authorStephen Finucane <stephen@that.guru>
Wed, 19 Sep 2018 20:03:33 +0000 (21:03 +0100)
committerStephen Finucane <stephen@that.guru>
Mon, 17 Jun 2019 13:55:52 +0000 (14:55 +0100)
commit19aad6096a13603c088461dcc7cf534289b8479a
treebe84756b71aac3e21c15337d69a64f6dc5027c67
parentd7f7f9ea8f5ec1f754b00b49850d9d980b5d12e1
parser: Handle IntegrityError for cover letters, comments

This was already done for patches but cover letters and comments were
not handled correctly, resulting in errors while parsing archives. While
we're here, we slightly modify how these exceptions are handle. Rather
than simply ignoring them, as we were doing, we raise a custom
exception. This allows us to specifically identify these types of
exceptions, print a log and still skip them (which we want, as seen in
commit d2eb1f6d2).

While we're here, we change from separate create-save calls to a
combined create-save call for both created CoverLetter and Comment
objects. We were already doing this for patches.

Signed-off-by: Stephen Finucane <stephen@that.guru>
(cherry picked from commit 300ba3eb283ab1af3dc5924e5ed540159c3ee0bc)
patchwork/management/commands/parsearchive.py
patchwork/management/commands/parsemail.py
patchwork/parser.py