()
| 149 | # async. |
| 150 | @sync_to_async |
| 151 | def sync_transaction(): |
| 152 | with transaction.atomic(using=using): |
| 153 | obj.save( |
| 154 | force_insert=must_create, |
| 155 | force_update=not must_create, |
| 156 | using=using, |
| 157 | ) |
| 158 | |
| 159 | await sync_transaction() |
| 160 | except IntegrityError: |