'This is subjective, but I don\'t trust get_or_create until #13906
gets fixed. It\'s probably fine, but this makes me happy for the moment
and solved a get_or_create we\'ve had in the past.'

def safer_get_or_create(self, defaults=None, **kw):

    with transaction.atomic():
        try:
            return (self.get(**kw), False)
        except self.model.DoesNotExist:
            if (defaults is not None):
                kw.update(defaults)
            return (self.create(**kw), True)
