# HG changeset patch # User Daniel Dourvaris # Date 2016-06-22 15:29:41 # Node ID f93543024b22d7af5120a2f999772ec53e89c907 # Parent 81a58befd9b0d95c2c9180713788235ea2bd1405 model: log exception if multiple repos rather than hard error diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -1379,10 +1379,11 @@ class Repository(Base, BaseModel): if cls == item_cls and instance.repo_name == repo_name: exist_in_session.append(instance) if exist_in_session: - if len(exist_in_session) > 1: - raise Exception('2 same name repos in session') - return exist_in_session[0] - + if len(exist_in_session) == 1: + return exist_in_session[0] + log.exception( + 'multiple repos with same name: %r' % exist_in_session) + q = session.query(cls).filter(cls.repo_name == repo_name) return q.scalar()