[Django]-How do I rollback transaction in django-rest-framework APIView?

3👍

try using transaction.atomic()

with transaction.atomic():
    serializer.save()
    transaction.set_rollback(True)

Leave a comment