              transaction.savepoint_commit(sid, using=self.db)
              return obj, False
          except DatabaseError:
              transaction.savepoint_rollback(sid, using=self.db)
              six.reraise(sys.exc_info())
  
      def _create_object_from_params(self, lookup, params):
          """
          Tries to create an object using passed params.
          Used by get_or_create and update_or_create
 
</s> remove             obj = self.model(**params)
            sid = transaction.savepoint(using=self.db)
 </s> add  </s> remove         except DatabaseError:
 </s> add         except DatabaseError as e: </s> remove             sid = transaction.savepoint(using=self.db)
 </s> add  </s> remove             exc_info = sys.exc_info()
            try:
                return self.get(**lookup), False
            except self.model.DoesNotExist:
                # Re-raise the DatabaseError with its original traceback.
                six.reraise(*exc_info)
 </s> add             if isinstance(e, IntegrityError):
                try:
                    return self.get(**lookup), False
                except self.model.DoesNotExist:
                    pass
            six.reraise(*sys.exc_info())
            six.reraise(*sys.exc_info())
              transaction.savepoint_commit(sid, using=self.db)
              return obj, False
          except DatabaseError:
              transaction.savepoint_rollback(sid, using=self.db)
            six.reraise(*sys.exc_info())
  
      def _create_object_from_params(self, lookup, params):
          """
          Tries to create an object using passed params.
          Used by get_or_create and update_or_create
keep keep keep keep replace keep keep keep keep keep
 Fixed #20761 -- Fixed DatabaseError handling in get_or_create and update_or_create. 
django/db/models/query.py