#NEWLINE# def _get_or_create( klass , **kwargs ) : #NEWLINE# #INDENT# 'Mimic logic Manager.get_or_create without savepoints' #NEWLINE# try : #NEWLINE# #INDENT# return klass . objects . get ( ** kwargs ) #NEWLINE# #UNINDENT# except kwargs . DoesNotExist : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return klass . objects . create ( ** kwargs ) #NEWLINE# #UNINDENT# except IntegrityError : #NEWLINE# #INDENT# return klass . objects . get ( ** kwargs )