Allura/allura/model/discuss.py
def new(cls, **props):
        '''Creates a new Thread instance, ensuring a unique _id.'''
        for i in range(5):
            try:
                thread = cls(**props)
                session(thread).flush(thread)
                return thread
            except DuplicateKeyError as err:
                log.warning(
                    'Got DuplicateKeyError: attempt #%s, trying again. %s', i, err)
                if i == 4:
                    raise
                session(thread).expunge(thread)
                continue
Creates a new Thread instance, ensuring a unique _id.
Creates a new Thread instance, ensuring a unique _id.
Creates a new Thread instance ensuring a unique _id .
def new(cls, **props):
        for i in range(5):
            try:
                thread = cls(**props)
                session(thread).flush(thread)
                return thread
            except DuplicateKeyError as err:
                log.warning(
                    'Got DuplicateKeyError: attempt #%s, trying again. %s', i, err)
                if i == 4:
                    raise
                session(thread).expunge(thread)
                continue
def new ( cls , ** props ) : for i in range ( 5 ) : try : thread = cls ( ** props ) session ( thread ) . flush ( thread ) return thread except DuplicateKeyError as err : log . warning ( 'Got DuplicateKeyError: attempt #%s, trying again. %s' , i , err ) if i == 4 : raise session ( thread ) . expunge ( thread ) continue
Creates a new Thread instance, ensuring a unique _id.
Creates a new Thread instance ensuring a unique _id .
'''Creates a new Thread instance, ensuring a unique _id.'''
cls