Show More
@@ -1373,7 +1373,13 b' class Repository(Base, BaseModel):' | |||
|
1373 | 1373 | |
|
1374 | 1374 | @classmethod |
|
1375 | 1375 | def get_by_repo_name(cls, repo_name): |
|
1376 | q = Session().query(cls).filter(cls.repo_name == repo_name) | |
|
1376 | session = Session() | |
|
1377 | for (klass, pkey), instance in session.identity_map.items(): | |
|
1378 | if cls == klass: | |
|
1379 | if getattr(instance, 'repo_name') == repo_name: | |
|
1380 | return instance | |
|
1381 | ||
|
1382 | q = session.query(cls).filter(cls.repo_name == repo_name) | |
|
1377 | 1383 | q = q.options(joinedload(Repository.fork))\ |
|
1378 | 1384 | .options(joinedload(Repository.user))\ |
|
1379 | 1385 | .options(joinedload(Repository.group)) |
General Comments 0
You need to be logged in to leave comments.
Login now