# HG changeset patch # User Marcin Kuzminski # Date 2020-10-08 20:28:51 # Node ID 6a8835849e04b7a82187c5d2368d92bc3b580a36 # Parent 3f5e9d55ae1941cbc9e88ccb0d43562177799cf6 observers: hide it for CE edition. - This hide is simple, but real logic is in the validate function which would only work if EE edition is installed. diff --git a/rhodecode/apps/repository/utils.py b/rhodecode/apps/repository/utils.py --- a/rhodecode/apps/repository/utils.py +++ b/rhodecode/apps/repository/utils.py @@ -107,5 +107,5 @@ def validate_default_reviewers(review_me return reviewers -def validate_observers(observer_members): +def validate_observers(observer_members, reviewer_rules): return {} diff --git a/rhodecode/config/middleware.py b/rhodecode/config/middleware.py --- a/rhodecode/config/middleware.py +++ b/rhodecode/config/middleware.py @@ -412,6 +412,7 @@ def sanitize_settings_and_apply_defaults """ settings.setdefault('rhodecode.edition', 'Community Edition') + settings.setdefault('rhodecode.edition_id', 'CE') if 'mako.default_filters' not in settings: # set custom default filters if we don't have it defined diff --git a/rhodecode/lib/base.py b/rhodecode/lib/base.py --- a/rhodecode/lib/base.py +++ b/rhodecode/lib/base.py @@ -293,6 +293,7 @@ def attach_context_attributes(context, r context.rc_config = rc_config context.rhodecode_version = rhodecode.__version__ context.rhodecode_edition = config.get('rhodecode.edition') + context.rhodecode_edition_id = config.get('rhodecode.edition_id') # unique secret + version does not leak the version but keep consistency context.rhodecode_version_hash = calculate_version_hash(config) diff --git a/rhodecode/public/css/main.less b/rhodecode/public/css/main.less --- a/rhodecode/public/css/main.less +++ b/rhodecode/public/css/main.less @@ -495,7 +495,8 @@ ul.auth_plugins { padding-top: 10px; } -#add_reviewer_input { +#add_reviewer_input, +#add_observer_input { padding-top: 10px } diff --git a/rhodecode/templates/pullrequests/pullrequest.mako b/rhodecode/templates/pullrequests/pullrequest.mako --- a/rhodecode/templates/pullrequests/pullrequest.mako +++ b/rhodecode/templates/pullrequests/pullrequest.mako @@ -177,7 +177,7 @@

${_('loading...')}

- + % if c.rhodecode_edition_id == 'EE':
## members goes here, filled via JS based on initial selection ! @@ -193,7 +193,12 @@
- + % else: +

${_('This feature is available in RhodeCode EE edition only. Contact {sales_email} to obtain a trial license.').format(sales_email='sales@rhodecode.com')|n}

+

+ Pull request observers allows adding users who don't need to leave mandatory votes, but need to be aware about certain changes. +

+ % endif diff --git a/rhodecode/templates/pullrequests/pullrequest_show.mako b/rhodecode/templates/pullrequests/pullrequest_show.mako --- a/rhodecode/templates/pullrequests/pullrequest_show.mako +++ b/rhodecode/templates/pullrequests/pullrequest_show.mako @@ -624,6 +624,7 @@ ## OBSERVERS + % if c.rhodecode_edition_id == 'EE': + % endif ## TODOs