Skip to content

Commit 229a4e5

Browse files
committed
add @atomic decorator to view method
This allows AppointmentWorkflowStepCompletion and Study updates to participate in the same database transaction. I decided against moving the step completion code into the StudyService as logically they are unrelated, and they belong to separate apps. Doing the former update in the view is also more consistent with what the other views are already doing.
1 parent 9078b5e commit 229a4e5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

manage_breast_screening/mammograms/views/appointment_views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ def get_context_data(self, **kwargs):
248248
)
249249
return context
250250

251+
@transaction.atomic
251252
def form_valid(self, form):
252253
form.save(
253254
StudyService(appointment=self.appointment, current_user=self.request.user)

0 commit comments

Comments
 (0)