with transcation.atomic()
with transcation.atomic()
submit_entity_unhandled
@transaction.atomic
to avoid future
changes that introduces errors in error handling logicsget_or_create
?Error Handling
means what are the correct business
logics when errors happenwith transaction.atomic():
= Task.objects.create(...) # or update some properties then task.save()
task submit_entity_unhandled()
# if response data is needed
foo_id = third party POST or PATCH
save `foo_id` to local DB
# if response data is not needed
with transaction.atomic():
local db changes()
third party POST or PATCH
Answer: