##// END OF EJS Templates
model: log exception if multiple repos rather than hard error
dan -
r252:f9354302 default
parent child Browse files
Show More
@@ -1379,9 +1379,10 b' class Repository(Base, BaseModel):'
1379 1379 if cls == item_cls and instance.repo_name == repo_name:
1380 1380 exist_in_session.append(instance)
1381 1381 if exist_in_session:
1382 if len(exist_in_session) > 1:
1383 raise Exception('2 same name repos in session')
1382 if len(exist_in_session) == 1:
1384 1383 return exist_in_session[0]
1384 log.exception(
1385 'multiple repos with same name: %r' % exist_in_session)
1385 1386
1386 1387 q = session.query(cls).filter(cls.repo_name == repo_name)
1387 1388 return q.scalar()
General Comments 0
You need to be logged in to leave comments. Login now