##// END OF EJS Templates
issue-tracker: use stored issueTracker patterns for repo instead of initializing model every time.
bart -
r4201:ecf6f84c stable
parent child Browse files
Show More
@@ -37,7 +37,7 b' from rhodecode.model import user_group'
37 from rhodecode.model import user
37 from rhodecode.model import user
38 from rhodecode.model.db import User
38 from rhodecode.model.db import User
39 from rhodecode.model.scm import ScmModel
39 from rhodecode.model.scm import ScmModel
40 from rhodecode.model.settings import VcsSettingsModel
40 from rhodecode.model.settings import VcsSettingsModel, IssueTrackerSettingsModel
41 from rhodecode.model.repo import ReadmeFinder
41 from rhodecode.model.repo import ReadmeFinder
42
42
43 log = logging.getLogger(__name__)
43 log = logging.getLogger(__name__)
@@ -226,6 +226,7 b' class RepoAppView(BaseAppView):'
226 self.db_repo_name = self.db_repo.repo_name
226 self.db_repo_name = self.db_repo.repo_name
227 self.db_repo_pull_requests = ScmModel().get_pull_requests(self.db_repo)
227 self.db_repo_pull_requests = ScmModel().get_pull_requests(self.db_repo)
228 self.db_repo_artifacts = ScmModel().get_artifacts(self.db_repo)
228 self.db_repo_artifacts = ScmModel().get_artifacts(self.db_repo)
229 self.db_repo_patterns = IssueTrackerSettingsModel(repo=self.db_repo)
229
230
230 def _handle_missing_requirements(self, error):
231 def _handle_missing_requirements(self, error):
231 log.error(
232 log.error(
@@ -31,7 +31,7 b' from rhodecode.lib.auth import ('
31 LoginRequired, HasRepoPermissionAnyDecorator, CSRFRequired)
31 LoginRequired, HasRepoPermissionAnyDecorator, CSRFRequired)
32 from rhodecode.model.forms import IssueTrackerPatternsForm
32 from rhodecode.model.forms import IssueTrackerPatternsForm
33 from rhodecode.model.meta import Session
33 from rhodecode.model.meta import Session
34 from rhodecode.model.settings import IssueTrackerSettingsModel, SettingsModel
34 from rhodecode.model.settings import SettingsModel
35
35
36 log = logging.getLogger(__name__)
36 log = logging.getLogger(__name__)
37
37
@@ -53,7 +53,7 b' class RepoSettingsIssueTrackersView(Repo'
53 c.active = 'issuetracker'
53 c.active = 'issuetracker'
54 c.data = 'data'
54 c.data = 'data'
55
55
56 c.settings_model = IssueTrackerSettingsModel(repo=self.db_repo)
56 c.settings_model = self.db_repo_patterns
57 c.global_patterns = c.settings_model.get_global_settings()
57 c.global_patterns = c.settings_model.get_global_settings()
58 c.repo_patterns = c.settings_model.get_repo_settings()
58 c.repo_patterns = c.settings_model.get_repo_settings()
59
59
@@ -79,7 +79,7 b' class RepoSettingsIssueTrackersView(Repo'
79 def repo_issuetracker_delete(self):
79 def repo_issuetracker_delete(self):
80 _ = self.request.translate
80 _ = self.request.translate
81 uid = self.request.POST.get('uid')
81 uid = self.request.POST.get('uid')
82 repo_settings = IssueTrackerSettingsModel(repo=self.db_repo_name)
82 repo_settings = self.db_repo_patterns
83 try:
83 try:
84 repo_settings.delete_entries(uid)
84 repo_settings.delete_entries(uid)
85 except Exception:
85 except Exception:
@@ -113,7 +113,7 b' class RepoSettingsIssueTrackersView(Repo'
113 def repo_issuetracker_update(self):
113 def repo_issuetracker_update(self):
114 _ = self.request.translate
114 _ = self.request.translate
115 # Save inheritance
115 # Save inheritance
116 repo_settings = IssueTrackerSettingsModel(repo=self.db_repo_name)
116 repo_settings = self.db_repo_patterns
117 inherited = (
117 inherited = (
118 self.request.POST.get('inherit_global_issuetracker') == "inherited")
118 self.request.POST.get('inherit_global_issuetracker') == "inherited")
119 repo_settings.inherit_global_settings = inherited
119 repo_settings.inherit_global_settings = inherited
General Comments 0
You need to be logged in to leave comments. Login now