Skip to content
Permalink
Browse files

Merge branch 'dev-v2.8' into 2.8

  • Loading branch information
amercader committed Jul 3, 2019
2 parents 08dcffb + 8e1cc60 commit 197f9b19254dad3056d1418d4bbfc5c604b39c4e
Showing with 18,437 additions and 8,620 deletions.
  1. +0 −9 .circleci-matrix.yml
  2. +102 −0 .circleci/config.yml
  3. +32 −0 CHANGELOG.rst
  4. +0 −68 circle.yml
  5. +1 −1 ckan/__init__.py
  6. +14 −7 ckan/authz.py
  7. +5 −1 ckan/config/environment.py
  8. +11 −1 ckan/config/middleware/flask_app.py
  9. +2 −2 ckan/controllers/user.py
  10. +4,811 −0 ckan/i18n/am/LC_MESSAGES/ckan.po
  11. +178 −184 ckan/i18n/ar/LC_MESSAGES/ckan.po
  12. +191 −196 ckan/i18n/bg/LC_MESSAGES/ckan.po
  13. +230 −231 ckan/i18n/ca/LC_MESSAGES/ckan.po
  14. +204 −206 ckan/i18n/cs_CZ/LC_MESSAGES/ckan.po
  15. +158 −165 ckan/i18n/da_DK/LC_MESSAGES/ckan.po
  16. +220 −215 ckan/i18n/de/LC_MESSAGES/ckan.po
  17. +256 −250 ckan/i18n/el/LC_MESSAGES/ckan.po
  18. +174 −184 ckan/i18n/en_AU/LC_MESSAGES/ckan.po
  19. +176 −186 ckan/i18n/en_GB/LC_MESSAGES/ckan.po
  20. +240 −236 ckan/i18n/es/LC_MESSAGES/ckan.po
  21. +238 −238 ckan/i18n/es_AR/LC_MESSAGES/ckan.po
  22. +4,844 −0 ckan/i18n/eu/LC_MESSAGES/ckan.po
  23. +99 −104 ckan/i18n/fa_IR/LC_MESSAGES/ckan.po
  24. +194 −191 ckan/i18n/fi/LC_MESSAGES/ckan.po
  25. +258 −258 ckan/i18n/fr/LC_MESSAGES/ckan.po
  26. +103 −108 ckan/i18n/gl/LC_MESSAGES/ckan.po
  27. +153 −156 ckan/i18n/he/LC_MESSAGES/ckan.po
  28. +168 −173 ckan/i18n/hr/LC_MESSAGES/ckan.po
  29. +101 −105 ckan/i18n/hu/LC_MESSAGES/ckan.po
  30. +111 −114 ckan/i18n/id/LC_MESSAGES/ckan.po
  31. +171 −177 ckan/i18n/is/LC_MESSAGES/ckan.po
  32. +217 −221 ckan/i18n/it/LC_MESSAGES/ckan.po
  33. +107 −110 ckan/i18n/ja/LC_MESSAGES/ckan.po
  34. +106 −109 ckan/i18n/km/LC_MESSAGES/ckan.po
  35. +141 −150 ckan/i18n/ko_KR/LC_MESSAGES/ckan.po
  36. +133 −143 ckan/i18n/lt/LC_MESSAGES/ckan.po
  37. +186 −191 ckan/i18n/lv/LC_MESSAGES/ckan.po
  38. +226 −224 ckan/i18n/mk/LC_MESSAGES/ckan.po
  39. +200 −200 ckan/i18n/mn_MN/LC_MESSAGES/ckan.po
  40. +186 −185 ckan/i18n/nl/LC_MESSAGES/ckan.po
  41. +193 −200 ckan/i18n/no/LC_MESSAGES/ckan.po
  42. +107 −111 ckan/i18n/pl/LC_MESSAGES/ckan.po
  43. +224 −220 ckan/i18n/pt_BR/LC_MESSAGES/ckan.po
  44. +218 −229 ckan/i18n/pt_PT/LC_MESSAGES/ckan.po
  45. +130 −135 ckan/i18n/ro/LC_MESSAGES/ckan.po
  46. +145 −157 ckan/i18n/ru/LC_MESSAGES/ckan.po
  47. +195 −201 ckan/i18n/sk/LC_MESSAGES/ckan.po
  48. +180 −189 ckan/i18n/sl/LC_MESSAGES/ckan.po
  49. +167 −167 ckan/i18n/sq/LC_MESSAGES/ckan.po
  50. +108 −115 ckan/i18n/sr/LC_MESSAGES/ckan.po
  51. +107 −115 ckan/i18n/sr_Latn/LC_MESSAGES/ckan.po
  52. +192 −196 ckan/i18n/sv/LC_MESSAGES/ckan.po
  53. +123 −122 ckan/i18n/th/LC_MESSAGES/ckan.po
  54. +261 −260 ckan/i18n/tr/LC_MESSAGES/ckan.po
  55. +99 −107 ckan/i18n/uk/LC_MESSAGES/ckan.po
  56. +196 −231 ckan/i18n/uk_UA/LC_MESSAGES/ckan.po
  57. +171 −180 ckan/i18n/vi/LC_MESSAGES/ckan.po
  58. +130 −138 ckan/i18n/zh_CN/LC_MESSAGES/ckan.po
  59. +111 −117 ckan/i18n/zh_TW/LC_MESSAGES/ckan.po
  60. +1 −1 ckan/lib/captcha.py
  61. +1 −1 ckan/lib/cli.py
  62. +6 −3 ckan/lib/helpers.py
  63. +3 −1 ckan/lib/navl/validators.py
  64. +7 −5 ckan/logic/action/get.py
  65. +9 −1 ckan/logic/auth/get.py
  66. +3 −2 ckan/logic/schema.py
  67. +9 −8 ckan/logic/validators.py
  68. +6 −1 ckan/model/license.py
  69. +1 −1 ckan/public-bs2/base/less/ckan.less
  70. +1 −1 ckan/public/base/css/fuchsia.css
  71. +1 −1 ckan/public/base/css/fuchsia.min.css
  72. +1 −1 ckan/public/base/css/green.css
  73. +1 −1 ckan/public/base/css/green.min.css
  74. +1 −1 ckan/public/base/css/main.css
  75. +1 −1 ckan/public/base/css/main.min.css
  76. +1 −1 ckan/public/base/css/maroon.css
  77. +1 −1 ckan/public/base/css/maroon.min.css
  78. +1 −1 ckan/public/base/css/red.css
  79. +1 −1 ckan/public/base/css/red.min.css
  80. +2 −0 ckan/public/base/javascript/modules/followers-counter.js
  81. +1 −1 ckan/public/base/javascript/modules/followers-counter.min.js
  82. +13 −3 ckan/public/base/javascript/modules/resource-reorder.js
  83. +1 −1 ckan/public/base/javascript/modules/resource-reorder.min.js
  84. +3 −0 ckan/public/base/javascript/modules/resource-upload-field.js
  85. +2 −1 ckan/public/base/javascript/modules/resource-upload-field.min.js
  86. +1 −1 ckan/public/base/less/ckan.less
  87. +1 −1 ckan/templates-bs2/group/member_new.html
  88. +1 −1 ckan/templates-bs2/organization/member_new.html
  89. +1 −1 ckan/templates/group/member_new.html
  90. +1 −1 ckan/templates/organization/member_new.html
  91. +1 −1 ckan/templates/organization/snippets/feeds.html
  92. +1 −1 ckan/templates/user/read_base.html
  93. +13 −23 ckan/templates/user/snippets/recaptcha.html
  94. +0 −15 ckan/tests/legacy/lib/test_navl.py
  95. +5 −4 ckan/tests/legacy/lib/test_solr_search_index.py
  96. +33 −3 ckan/tests/lib/navl/test_validators.py
  97. +48 −0 ckan/tests/lib/test_helpers.py
  98. +7 −2 ckan/tests/logic/action/test_get.py
  99. +27 −0 ckan/tests/logic/test_validators.py
  100. +15 −1 ckan/tests/model/licenses.v1
  101. +14 −1 ckan/tests/model/licenses.v2
  102. +28 −9 ckan/tests/model/test_license.py
  103. +2 −2 ckan/views/user.py
  104. +8 −1 ckanext/datapusher/logic/action.py
  105. +5 −1 ckanext/datastore/backend/postgres.py
  106. +1 −1 ckanext/datastore/controller.py
  107. +23 −0 ckanext/datastore/tests/test_chained_auth_functions.py
  108. +17 −0 ckanext/datastore/tests/test_search.py
  109. +1 −16 ckanext/imageview/tests/test_view.py
  110. +10 −1 ckanext/reclineview/plugin.py
  111. +5 −1 ckanext/reclineview/theme/public/recline_view.js
  112. +2 −2 ckanext/reclineview/theme/public/recline_view.min.js
  113. +1 −0 ckanext/reclineview/theme/templates/recline_view.html
  114. +33 −0 doc/maintaining/configuration.rst
  115. +0 −1 doc/maintaining/installing/install-from-docker-compose.rst
  116. +1 −0 setup.py
  117. +49 −0 test-core-circle-ci.ini

This file was deleted.

@@ -0,0 +1,102 @@
version: 2
jobs:
test:
docker:
- image: python:2
environment:
CKAN_DATASTORE_POSTGRES_DB: datastore_test
CKAN_DATASTORE_POSTGRES_READ_USER: datastore_read
CKAN_DATASTORE_POSTGRES_READ_PWD: pass
CKAN_DATASTORE_POSTGRES_WRITE_USER: datastore_write
CKAN_DATASTORE_POSTGRES_WRITE_PWD: pass
CKAN_POSTGRES_DB: ckan_test
CKAN_POSTGRES_USER: ckan_default
CKAN_POSTGRES_PWD: pass
PGPASSWORD: ckan
NODE_TESTS_CONTAINER: 2
NOSETEST_COMMON_OPTIONS: -v --ckan --reset-db --with-pylons=test-core-circle-ci.ini --nologcapture --with-coverage --cover-package=ckan --cover-package=ckanext --with-xunit --xunit-file=/root/junit/junit.xml ckan ckanext
- image: postgres:10
environment:
POSTGRES_USER: ckan
POSTGRES_PASSWORD: ckan
name: ckan-postgres
- image: redis:3
name: ckan-redis

parallelism: 4

steps:
- checkout

- run: |
# SO Dependencies
apt update
case $CIRCLE_NODE_INDEX in
$NODE_TESTS_CONTAINER)
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt install -y nodejs
npm install mocha-phantomjs@3.5.0 phantomjs@~1.9.1
;;
esac
apt install -y postgresql-client solr-jetty openjdk-8-jdk
# Python Dependencies
pip install -r requirement-setuptools.txt
pip install -r requirements.txt
pip install -r dev-requirements.txt
python setup.py develop
# SOLR config
cp ~/project/ckan/config/solr/schema.xml /etc/solr/conf/schema.xml
service jetty9 restart || true # erroring out but does seem to work
# Database Creation
psql --host=ckan-postgres --username=ckan --command="CREATE USER ${CKAN_POSTGRES_USER} WITH PASSWORD '${CKAN_POSTGRES_PWD}' NOSUPERUSER NOCREATEDB NOCREATEROLE;"
createdb --encoding=utf-8 --host=ckan-postgres --username=ckan --owner=${CKAN_POSTGRES_USER} ${CKAN_POSTGRES_DB}
psql --host=ckan-postgres --username=ckan --command="CREATE USER ${CKAN_DATASTORE_POSTGRES_READ_USER} WITH PASSWORD '${CKAN_DATASTORE_POSTGRES_READ_PWD}' NOSUPERUSER NOCREATEDB NOCREATEROLE;"
psql --host=ckan-postgres --username=ckan --command="CREATE USER ${CKAN_DATASTORE_POSTGRES_WRITE_USER} WITH PASSWORD '${CKAN_DATASTORE_POSTGRES_WRITE_PWD}' NOSUPERUSER NOCREATEDB NOCREATEROLE;"
createdb --encoding=utf-8 --host=ckan-postgres --username=ckan --owner=${CKAN_DATASTORE_POSTGRES_WRITE_USER} ${CKAN_DATASTORE_POSTGRES_DB}
# Database Initialization
paster datastore -c test-core-circle-ci.ini set-permissions | psql --host=ckan-postgres --username=ckan
paster db init -c test-core-circle-ci.ini
# Tests Backend, split across containers by segments
- run: |
mkdir -p ~/junit
case $CIRCLE_NODE_INDEX in
0) nosetests $NOSETEST_COMMON_OPTIONS --segments 0123
;;
1) nosetests $NOSETEST_COMMON_OPTIONS --segments 4567
;;
2) nosetests $NOSETEST_COMMON_OPTIONS --segments 89ab
;;
3) nosetests $NOSETEST_COMMON_OPTIONS --segments cdef
;;
esac
- store_test_results:
path: ~/junit

# Tests Frontend, only in one container
- run:
command: |
case $CIRCLE_NODE_INDEX in
$NODE_TESTS_CONTAINER) paster serve test-core-circle-ci.ini
;;
esac
background: true
- run:
command: |
case $CIRCLE_NODE_INDEX in
$NODE_TESTS_CONTAINER)
sleep 5
/root/project/node_modules/mocha-phantomjs/bin/mocha-phantomjs \
http://localhost:5000/base/test/index.html
;;
esac
workflows:
version: 2
build_and_test:
jobs:
- test
@@ -7,6 +7,38 @@
Changelog
---------

v.2.8.3 2019-07-03
==================

General notes:
* Note: This version does not requires a requirements upgrade on source installations
* Note: This version does not requires a database upgrade
* Note: This version does not require a Solr schema upgrade

Fixes:

* Fix `include_total` in `datastore_search` (`#4446 <https://github.com/ckan/ckan/issues/4446>`_)
* Fix problem with reindex-fast (`#4352 <https://github.com/ckan/ckan/issues/4352>`_)
* Fix `ValueError` in `url_validator` (`#4629 <https://github.com/ckan/ckan/issues/4629>`_)
* Strip local path when uploading file in IE (`#4608 <https://github.com/ckan/ckan/issues/4608>`_)
* Increase size of h1 headings to 1.8em (`#4665 <https://github.com/ckan/ckan/issues/4665>`_)
* Fix broken div nesting in the `user/read_base.html` (`#4672 <https://github.com/ckan/ckan/issues/4672>`_)
* `package_search` parameter `fl` accepts list-like values (`#4464 <https://github.com/ckan/ckan/issues/4464>`_)
* Use `chained_auth_function` with core auth functions (`#4491 <https://github.com/ckan/ckan/issues/4491>`_)
* Allow translation of custom licenses (`#4594 <https://github.com/ckan/ckan/issues/4594>`_)
* Fix delete button links (`#4598 <https://github.com/ckan/ckan/issues/4598>`_)
* Fix hardcoded root paths (`#4662 <https://github.com/ckan/ckan/issues/4662>`_)
* Fix reCaptcha (`#4732 <https://github.com/ckan/ckan/issues/4732>`_)
* Fix incremented follower-counter (`#4767 <https://github.com/ckan/ckan/issues/4767>`_)
* Fix breadcrumb on /datasets (`#4405 <https://github.com/ckan/ckan/issues/4405>`_)
* Fix `root_path` when using mod_wsgi (`#4452 <https://github.com/ckan/ckan/issues/4452>`_)
* Correctly insert root_path for urls generated with _external flag (`#4722 <https://github.com/ckan/ckan/issues/4722>`_)
* Make reorder resources button translatable (`#4838 <https://github.com/ckan/ckan/issues/4838>`_)
* Fix `feeds` urls generation (`#4854 <https://github.com/ckan/ckan/pull/4854>`_)
* More robust auth functions for `resource_view_show` (`#4827 <https://github.com/ckan/ckan/issues/4827>`_)
* Allow to customize the DataProxy URL (`#4874 <https://github.com/ckan/ckan/issues/4874>`_)
* Allow custom CKAN callback URL for the DataPusher (`#4878 <https://github.com/ckan/ckan/issues/4878>`_)
* Add `psycopg>=2.8` support (`#4841 <https://github.com/ckan/ckan/pull/4841>`_)

v.2.8.2 2018-12-12
==================

This file was deleted.

@@ -1,6 +1,6 @@
# encoding: utf-8

__version__ = '2.8.2'
__version__ = '2.8.3'

__description__ = 'CKAN Software'
__long_description__ = \
@@ -102,13 +102,19 @@ def _build(self):
fetched_auth_functions[name] = auth_function

for name, func_list in chained_auth_functions.iteritems():
if name not in fetched_auth_functions:
if (name not in fetched_auth_functions and
name not in self._functions):
raise Exception('The auth %r is not found for chained auth' % (
name))
# create the chain of functions in the correct order
for func in reversed(func_list):
prev_func = fetched_auth_functions[name]
fetched_auth_functions[name] = functools.partial(func, prev_func)
if name in fetched_auth_functions:
prev_func = fetched_auth_functions[name]
else:
# fallback to chaining off the builtin auth function
prev_func = self._functions[name]
fetched_auth_functions[name] = (
functools.partial(func, prev_func))

# Use the updated ones in preference to the originals.
self._functions.update(fetched_auth_functions)
@@ -197,10 +203,11 @@ def is_authorized(action, context, data_dict=None):
# access straight away
if not getattr(auth_function, 'auth_allow_anonymous_access', False) \
and not context.get('auth_user_obj'):
return {'success': False,
'msg': '{0} requires an authenticated user'
.format(auth_function)
}
return {
'success': False,
'msg': 'Action {0} requires an authenticated user'.format(
action)
}

return auth_function(context, data_dict)
else:
@@ -44,7 +44,10 @@ def load_environment(global_conf, app_conf):
# Required by the deliverance plugin and iATI
from pylons.wsgiapp import PylonsApp
import pkg_resources
find_controller_generic = PylonsApp.find_controller
find_controller_generic = getattr(
PylonsApp.find_controller,
'_old_find_controller',
PylonsApp.find_controller)

# This is from pylons 1.0 source, will monkey-patch into 0.9.7
def find_controller(self, controller):
@@ -64,6 +67,7 @@ def find_controller(self, controller):
self.controller_classes[controller] = mycontroller
return mycontroller
return find_controller_generic(self, controller)
find_controller._old_find_controller = find_controller_generic
PylonsApp.find_controller = find_controller

os.environ['CKAN_CONFIG'] = global_conf['__file__']
@@ -302,6 +302,10 @@ def ckan_after_request(response):
# Set CORS headers if necessary
response = set_cors_headers_for_response(response)

# Default to cache-control private if it was not set
if response.cache_control.private is None:
response.cache_control.private = True

return response


@@ -362,15 +366,21 @@ def can_handle_request(self, environ):
`origin` can be either 'core' or 'extension' depending on where
the route was defined.
'''

urls = self.url_map.bind_to_environ(environ)

try:
rule, args = urls.match(return_rule=True)
origin = 'core'
if hasattr(rule, 'ckan_core') and not rule.ckan_core:
origin = 'extension'
log.debug('Flask route match, endpoint: {0}, args: {1}, '
'origin: {2}'.format(rule.endpoint, args, origin))

# Disable built-in flask's ability to prepend site root to
# generated url, as we are going to use locale and existing
# logic is not flexible enough for this purpose
environ['SCRIPT_NAME'] = ''

return (True, self.app_name, origin)
except HTTPException:
return (False, self.app_name)
@@ -497,7 +497,7 @@ def request_reset(self):
mailer.send_reset_link(user_obj)
h.flash_success(_('Please check your inbox for '
'a reset code.'))
h.redirect_to('/')
h.redirect_to(u'home.index')
except mailer.MailerException as e:
h.flash_error(_('Could not send reset link: %s') %
text_type(e))
@@ -542,7 +542,7 @@ def perform_reset(self, id):
mailer.create_reset_key(user_obj)

h.flash_success(_("Your password has been reset."))
h.redirect_to('/')
h.redirect_to(u'home.index')
except NotAuthorized:
h.flash_error(_('Unauthorized to edit user %s') % id)
except NotFound as e:

0 comments on commit 197f9b1

Please sign in to comment.
You can’t perform that action at this time.