Re: Response 4xx rolls back database

2020-03-30 Thread Linovia
Hi, If you want to apply changes and return a 400 error code, you’ll need to commit the current transaction. Browse the Django documentation about transaction and you’ll find how to do that. Regards, Xavier O. Linovia. Le 30 mars 2020 à 18:44 +0200, theo , a écrit : > Hey > > I have noticed tod

Response 4xx rolls back database

2020-03-30 Thread theo
Hey I have noticed today that 4xx Responses roll back the database I have my return statement from my ApiView as follows: return Response(serializer.errors, status=400) and I want to update a model instance with some details but they are not saved. When I change the status to 2xx the