feature: adds handling CE and EE versions
This commit is contained in:
parent
b5c53fab64
commit
edf6be86a1
1 changed files with 7 additions and 1 deletions
|
|
@ -33,6 +33,8 @@ import collections
|
|||
import dataclasses as dataclasses
|
||||
from copy import deepcopy
|
||||
|
||||
from pyramid.threadlocal import get_current_registry
|
||||
|
||||
from rhodecode.lib.pyramid_utils import get_current_request
|
||||
|
||||
from rhodecode.lib.vcs.nodes import FileNode
|
||||
|
|
@ -2227,7 +2229,11 @@ class PullRequestModel(BaseModel):
|
|||
if repo_type not in ["hg", "git"]:
|
||||
return False
|
||||
|
||||
if pull_request.settings and "close_branch_before_merging" in pull_request.settings:
|
||||
registry = get_current_registry()
|
||||
is_enterprise = registry.settings.get("rhodecode.edition_id") == "EE"
|
||||
|
||||
if is_enterprise and pull_request.settings and "close_branch_before_merging" in pull_request.settings:
|
||||
# this feature is available only for the EE edition
|
||||
return pull_request.settings["close_branch_before_merging"]
|
||||
|
||||
key = "rhodecode_{}_close_branch_before_merging".format(repo_type)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue