Changes between Initial Version and Version 1 of Ticket #33649
- Timestamp:
- Apr 18, 2022, 12:03:33 AM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #33649
- Property Cc added
- Property Component Uncategorized → Database layer (models, ORM)
- Property Resolution → invalid
- Property Status new → closed
- Property Summary bulk_create with ignore_conflicts=True and ForeignKey fails → bulk_create() with ignore_conflicts=True and ForeignKey fails
-
Ticket #33649 – Description
initial v1 6 6 But if ignore_conflicts=True is needed since some of the objects using in the bulk_create may already be saved to the DB then it works only for Django < 3.2. 7 7 With Django >= 3.2 (including 4.0.4) it fails with: 8 ValueError: bulk_create() prohibited to prevent data loss due to unsaved related object 'reporter'.8 `ValueError: bulk_create() prohibited to prevent data loss due to unsaved related object 'reporter'`. 9 9 10 10 Find attached a test app which reproduces this issue with a minimal example, see