]> 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>
Thu, 20 Sep 2018 21:06:14 +0000 (22:06 +0100)
commit300ba3eb283ab1af3dc5924e5ed540159c3ee0bc
tree60bc0b8621e260a397a7e1902ba3f091237c6dcf
parent133091da0a527ef8fe89aea38c4855973b48d5f1
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>
patchwork/management/commands/parsearchive.py
patchwork/management/commands/parsemail.py
patchwork/parser.py