]> git.ipfire.org Git - thirdparty/patchwork.git/commit
parser: prevent IntegrityErrors
authorJeremy Kerr <jk@ozlabs.org>
Thu, 16 Apr 2020 01:29:26 +0000 (09:29 +0800)
committerStephen Finucane <stephen@that.guru>
Sat, 18 Apr 2020 11:57:17 +0000 (12:57 +0100)
commit91dce3e077ebdef833afd06a8407e1012929d929
treee85fea00ae2a8dcc5556ca5bf257a8c39f813abe
parent9463c2b3038fd278ef1a7de4a370d40862379483
parser: prevent IntegrityErrors

Currently, the parser relies on causing (and catching) IntegrityErrors
on patch insert to catch duplicate (msgid,project) mails.

This change performs an atomic select -> insert instead.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stephen Finucane <stephen@that.guru>
[stephenfin: Remove 'expectedFailure' marker again]
(cherry picked from commit 947c6aae94b7b554ca701c1d7e5baf000759ed2d)
patchwork/parser.py
patchwork/tests/test_parser.py