##// END OF EJS Templates
gists: fix problem of deleted gists repositories.
marcink -
r2817:ae0b3477 default
parent child Browse files
Show More
@@ -33,6 +33,7 b' from pyramid.threadlocal import get_curr'
33 33 from rhodecode.lib.utils2 import (
34 34 safe_unicode, unique_id, safe_int, time_to_datetime, AttributeDict)
35 35 from rhodecode.lib.ext_json import json
36 from rhodecode.lib.vcs import VCSError
36 37 from rhodecode.model import BaseModel
37 38 from rhodecode.model.db import Gist
38 39 from rhodecode.model.repo import RepoModel
@@ -98,7 +99,11 b' class GistModel(BaseModel):'
98 99 :param gist_access_id:
99 100 """
100 101 repo = Gist.get_by_access_id(gist_access_id)
101 commit = repo.scm_instance().get_commit(commit_id=revision)
102 vcs_repo = repo.scm_instance()
103 if not vcs_repo:
104 raise VCSError('Failed to load gist repository for {}'.format(repo))
105
106 commit = vcs_repo.get_commit(commit_id=revision)
102 107 return commit, [n for n in commit.get_node('/')]
103 108
104 109 def create(self, description, owner, gist_mapping,
General Comments 0
You need to be logged in to leave comments. Login now