diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2015-06-05 14:33:13 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2015-06-05 14:37:48 +0800 |
commit | 41d5ceb82b5d4297570b73639517b642fab0c45f (patch) | |
tree | 87af4cff500d1dcd39be8d3678ec8a81f0fefd35 /docs/INSTALL | |
parent | 30bb271ca25b9652744c3c17d9bc35cde91c6dc3 (diff) | |
download | patchwork-41d5ceb82b5d4297570b73639517b642fab0c45f.tar.bz2 patchwork-41d5ceb82b5d4297570b73639517b642fab0c45f.tar.xz |
patchwork/parser: Adapt for new unsaved-foreign-key behaviour in django 1.8
Django 1.8 no longer supports assignment of unsaved models to
ForeignKey fields:
File "/home/jk/devel/patchwork/patchwork/tests/test_patchparser.py", line 75, in setUp
(self.patch, self.comment) = find_content(self.project, email)
File "/home/jk/devel/patchwork/patchwork/bin/parsemail.py", line 231, in find_content
headers = mail_headers(mail))
File "/home/jk/devel/patchwork/lib/python/django/db/models/base.py", line 468, in __init__
setattr(self, field.name, rel_obj)
File "/home/jk/devel/patchwork/lib/python/django/db/models/fields/related.py", line 668, in __set__
(value, self.field.rel.to._meta.object_name)
ValueError: Cannot assign "<Patch: Test Subject>": "Patch" instance isn't saved in the database.
Even though we'd be guaranteed to save the patch before the comment, we
need to avoid this error.
This change defers the assigment of Comment.patch until we know we have
a saved Patch instance.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'docs/INSTALL')
0 files changed, 0 insertions, 0 deletions