Debug reset: put the whole request in a transaction.

This commit is contained in:
Tom Hacohen committed 2020-07-08 17:58:29 +03:00
1 parent cc163d27af
commit ee23707fff
1 file changed
+1
+1
View File
@@ -778,6 +778,7 @@ class TestAuthenticationViewSet(viewsets.ViewSet):
if not settings.DEBUG:
return HttpResponseBadRequest("Only allowed in debug mode.")
with transaction.atomic():
user = get_object_or_404(User.objects.all(), username=request.data.get('user').get('username'))
# Only allow test users for extra safety