﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20463	.get_or_create() leaves Postgres in 'current transaction is aborted...' state if da DataError occurs in create	Ulrich Petri	nobody	"Calling .get_or_create() with invalid data (e.g. broken UTF-8) in any of the fields in the 'default' argument causes a DataError (previously DatabaseError) to be thrown.

On Postgres this leads to the current transaction being left in the ""InternalError: current transaction is aborted, commands ignored until end of transaction block"" state.

The reason for this is that .get_or_create() creates a savepoint but only rolls it back on IntegrityError, which DataError is not a subclass of.

I'll attach a diff with a test for this behaviour."	Bug	closed	Database layer (models, ORM)	1.4	Release blocker	fixed			Accepted	0	0	0	0	0	0
