Skip to content

Commit

Permalink
Merge branch 'master' into 3229-api-blueprint
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Aug 31, 2017
2 parents 6e68c51 + 42d2f01 commit 97bbcdc
Show file tree
Hide file tree
Showing 232 changed files with 163,150 additions and 149,529 deletions.
236 changes: 189 additions & 47 deletions CHANGELOG.rst
Expand Up @@ -7,64 +7,137 @@
Changelog
---------

v2.7.0 TBA
==========
v2.7.0 2017-08-02
=================

Note: Starting from this version, CKAN requires at least Postgres 9.3

Note: This version requires a requirements upgrade on source installations

Note: This version requires a database upgrade

Note: This version does not require a Solr schema upgrade (You may want to
upgrade the schema if you want to target Solr>=5, see #2914)

Note: There are several old features being officially deprecated starting from
this version. Check the *Deprecations* section to be prepared.


Major:
* datatables_view resource view plugin (`#3444 <https://github.com/ckan/ckan/pull/3444>`_)
* IDatastoreBackend plugins for replacing default postgres backend (`#3437 <https://github.com/ckan/ckan/pull/3437>`_)
* datastore_search new result formats and performance improvements (`#3523 <https://github.com/ckan/ckan/pull/3523>`_)
* PL/PGSQL triggers for datastore tables (`#3428 <https://github.com/ckan/ckan/pull/3428>`_)
* Datastore dump CLI commands (`#3384 <https://github.com/ckan/ckan/pull/3384>`_)
* Wrap/override actions defined in other plugins (`#3494 <https://github.com/ckan/ckan/pull/3494>`_)
* Datastore table data dictionary stored as postgres comments (`#3414 <https://github.com/ckan/ckan/pull/3414>`_)
* Common session object for Flask and Pylons (`#3208 <https://github.com/ckan/ckan/pull/3208>`_)
* Rename deleted datasets when they conflict with new ones (`#3370 <https://github.com/ckan/ckan/pull/3370>`_)
* Datastore dump more formats: CSV, TSV, XML, JSON; BOM option (`#3390 <https://github.com/ckan/ckan/pull/3390>`_)
* Common requests code for Flask and Pylons (`#3212 <https://github.com/ckan/ckan/pull/3212>`_)
* Generate complete datastore dump files (`#3344 <https://github.com/ckan/ckan/pull/3344>`_)
* A new system for asynchronous background jobs (`#3165 <https://github.com/ckan/ckan/pull/3165>`_). The old Celery-based system is still available but deprecated. Please refer to the `documentation <http://docs.ckan.org/en/ckan-2.7.0/maintaining/background-tasks.html>`_ for details.
* New datatables_view resource view plugin for tabular data (#3444)
* IDataStoreBackend plugins for replacing the default DataStore Postgres backend (#3437)
* datastore_search new result formats and performance improvements (#3523)
* PL/PGSQL triggers for DataStore tables (#3428)
* DataStore dump CLI commands (#3384)
* Wrap/override actions defined in other plugins (#3494)
* DataStore table data dictionary stored as postgres comments (#3414)
* Common session object for Flask and Pylons (#3208)
* Rename deleted datasets when they conflict with new ones (#3370)
* DataStore dump more formats: CSV, TSV, XML, JSON; BOM option (#3390)
* Common requests code for Flask and Pylons (#3212)
* Generate complete datastore dump files (#3344)
* A new system for asynchronous background jobs (#3165)

Minor:
* Renamed example theme plugin (`#3576 <https://github.com/ckan/ckan/pull/3576>`_)
* Localization support for groups (`#3559 <https://github.com/ckan/ckan/pull/3559>`_)
* Create new resource views when format changes (`#3515 <https://github.com/ckan/ckan/pull/3515>`_)
* Email field validation (`#3568 <https://github.com/ckan/ckan/pull/3568>`_)
* datastore_run_triggers sysadmin-only action to apply triggers to existing data (`#3565 <https://github.com/ckan/ckan/pull/3565>`_)
* Docs updated for Ubuntu 16.04 (`#3544 <https://github.com/ckan/ckan/pull/3544>`_)
* Upgrade leaflet to 0.7.7 (`#3534 <https://github.com/ckan/ckan/pull/3534>`_)
* Datapusher CLI always-answer-yes option (`#3524 <https://github.com/ckan/ckan/pull/3524>`_)
* Added docs for all plugin interfaces (`#3519 <https://github.com/ckan/ckan/pull/3519>`_)
* Datastore dumps nested columns as JSON (`#3487 <https://github.com/ckan/ckan/pull/3487>`_)
* Faster/optional datastore_search total calculation (`#3467 <https://github.com/ckan/ckan/pull/3467>`_)
* Faster group_activity_query (`#3466 <https://github.com/ckan/ckan/pull/3466>`_)
* Faster query performance (`#3430 <https://github.com/ckan/ckan/pull/3430>`_)
* Marked remaining JS strings translatable (`#3423 <https://github.com/ckan/ckan/pull/3423>`_)
* Upgrade font-awesome to 4.0.3 (`#3400 <https://github.com/ckan/ckan/pull/3400>`_)
* group/organization_show include_dataset_count option (`#3385 <https://github.com/ckan/ckan/pull/3385>`_)
* image_formats config option for image viewer (`#3380 <https://github.com/ckan/ckan/pull/3380>`_)
* click may now be used for CLI interfaces: use load_config instead of CkanCommand (`#3384 <https://github.com/ckan/ckan/pull/3384>`_)
* package_search option to return only names/ids (`#3427 <https://github.com/ckan/ckan/pull/3427>`_)
* user_list all_fields option (`#3353 <https://github.com/ckan/ckan/pull/3353>`_)
* Error controller may now be overridden (`#3340 <https://github.com/ckan/ckan/pull/3340>`_)
* Plural translations in JS (`#3211 <https://github.com/ckan/ckan/pull/3211>`_)
* Support JS translations in extensions (`#3272 <https://github.com/ckan/ckan/pull/3272>`_)
* Requirements upgraded (`#3305 <https://github.com/ckan/ckan/pull/3305>`_)
* Dockerfile updates (`#3295 <https://github.com/ckan/ckan/pull/3295>`_)

API changes and deprecations:
* Renamed example theme plugin (#3576)
* Localization support for groups (#3559)
* Create new resource views when format changes (#3515)
* Email field validation (#3568)
* datastore_run_triggers sysadmin-only action to apply triggers to existing data (#3565)
* Docs updated for Ubuntu 16.04 (#3544)
* Upgrade leaflet to 0.7.7 (#3534)
* Datapusher CLI always-answer-yes option (#3524)
* Added docs for all plugin interfaces (#3519)
* DataStore dumps nested columns as JSON (#3487)
* Faster/optional datastore_search total calculation (#3467)
* Faster group_activity_query (#3466)
* Faster query performance (#3430)
* Marked remaining JS strings translatable (#3423)
* Upgrade font-awesome to 4.0.3 (#3400)
* group/organization_show include_dataset_count option (#3385)
* image_formats config option for image viewer (#3380)
* click may now be used for CLI interfaces: use load_config instead of CkanCommand (#3384)
* package_search option to return only names/ids (#3427)
* user_list all_fields option (#3353)
* Error controller may now be overridden (#3340)
* Plural translations in JS (#3211)
* Support JS translations in extensions (#3272)
* Requirements upgraded (#3305)
* Dockerfile updates (#3295)
* Fix activity test to use utcnow (#3644)
* Changed required permission from 'update' to 'manage_group' (#3631)
* Catch invalid sort param exception (#3630)
* Choose direction of recreated package relationship depending on its type (#3626)
* Fix render_datetime for dates before year 1900 (#3611)
* Fix KeyError in 'package_create' (#3027)
* Allow slug preview to work with autocomplete fields (#2501)
* Fix filter results button not working for organization/group (#3620)
* Allow underscores in URL slug preview on create dataset (#3612)
* Fallback to po file translations on ``h.get_translated()`` (#3577)
* Fix Fanstatic URL on non-root installs (#3618)
* Fixed escaping issues with ``helpers.mail_to`` and datapusher logs
* Autocomplete fields are more responsive - 300ms timeout instead of 1s (#3693)
* Fixed dataset count display for groups (#3711)
* Restrict access to form pages (#3684)
* Render_datetime can handle dates before year 1900 (#2228)

API changes:
* ``organization_list_for_user`` (and the ``h.organizations_available()``
helper) now return all organizations a user belongs to regardless of
capacity (Admin, Editor or Member), not just the ones where she is an
administrator (`#2457 <https://github.com/ckan/ckan/pull/2457>`_)
administrator (#2457)
* ``organization_list_for_user`` (and the ``h.organizations_available()``
helper) now default to not include package_count. Pass
include_dataset_count=True if you need the package_count values.
* ``resource['size']`` will change from string to long integer (`#3205 <https://github.com/ckan/ckan/pull/3205>`_)
* upgrade Font-Awesome from version 3.2.1 to 4.0.3
please refer to
* ``resource['size']`` will change from string to long integer (#3205)
* Font Awesome has been upgraded from version 3.2.1 to 4.0.3 .Please refer to
https://github.com/FortAwesome/Font-Awesome/wiki/Upgrading-from-3.2.1-to-4
to upgrade your code accordingly.
to upgrade your code accordingly if you are using custom themes.

Deprecations:

* The API versions 1 and 2 (also known as the REST API, ie ``/api/rest/*`` will removed
in favour of the version 3 (action API, ``/api/action/*``), which was introduced in
CKAN 2.0. The REST API will be removed on CKAN 2.8.
* The default theme included in CKAN core will switch to use Bootstrap 3 instead of
Bootstrap 2 in CKAN 2.8. The current Bootstrap 2 based templates will still be included
in the next CKAN versions, so existing themes will still work. Bootstrap 2 templates will
be eventually removed though, so instances are encouraged to update their themes using
the available documentation (https://getbootstrap.com/migration/)
* The activity stream related actions ending with ``*_list`` (eg ``package_activity_list``)
and ``*_html`` (eg ``package_activity_list_html``) will be removed in CKAN 2.8 in favour of
more efficient alternatives and are now deprecated.
* The legacy revisions controller (ie ``/revisions/*``) will be completely removed in CKAN 2.8.
* The old Celery based background jobs will be removed in CKAN 2.8 in favour of the new RQ based
jobs (http://docs.ckan.org/en/latest/maintaining/background-tasks.html). Extensions can still
of course use Celery but they will need to handle the management themselves.

v2.6.3 2017-08-02
=================

* Fix in organization / group form image URL field (#3661)
* Fix activity test to use utcnow (#3644)
* Changed required permission from 'update' to 'manage_group' (#3631)
* Catch invalid sort param exception (#3630)
* Choose direction of recreated package relationship depending on its type (#3626)
* Fix render_datetime for dates before year 1900 (#3611)
* Fix KeyError in 'package_create' (#3027)
* Allow slug preview to work with autocomplete fields (#2501)
* Fix filter results button not working for organization/group (#3620)
* Allow underscores in URL slug preview on create dataset (#3612)
* Create new resource view if resource format changed (#3515)
* Fixed escaping issues with `helpers.mail_to` and datapusher logs
* Autocomplete fields are more responsive - 300ms timeout instead of 1s (#3693)
* Fixed dataset count display for groups (#3711)
* Restrict access to form pages (#3684)

v2.6.2 2017-03-22
=================

* Use fully qualified urls for reset emails (#3486)
* Fix edit_resource for resource with draft state (#3480)
* Tag fix for group/organization pages (#3460)
* Setting of datastore_active flag moved to separate function (#3481)

v2.6.1 2017-02-22
=================
Expand Down Expand Up @@ -181,6 +254,33 @@ Bug fixes:
API changes and deprecations:
* Replace `c.__version__` with new helper `h.ckan_version()` (`#3103 <https://github.com/ckan/ckan/pull/3103>`_)

v2.5.6 2017-08-02
=================

* Fix in organization / group form image URL field (#3661)
* Fix activity test to use utcnow (#3644)
* Changed required permission from 'update' to 'manage_group' (#3631)
* Catch invalid sort param exception (#3630)
* Choose direction of recreated package relationship depending on its type (#3626)
* Fix render_datetime for dates before year 1900 (#3611)
* Fix KeyError in 'package_create' (#3027)
* Allow slug preview to work with autocomplete fields (#2501)
* Fix filter results button not working for organization/group (#3620)
* Allow underscores in URL slug preview on create dataset (#3612)
* Create new resource view if resource format changed (#3515)
* Fixed incorrect escaping in `mail_to` and datapusher's log
* Autocomplete fields are more responsive - 300ms timeout instead of 1s (#3693)
* Fixed dataset count display for groups (#3711)
* Restrict access to form pages (#3684)

v2.5.5 2017-03-22
=================

* Use fully qualified urls for reset emails (#3486)
* Fix edit_resource for resource with draft state (#3480)
* Tag fix for group/organization pages (#3460)
* Setting of datastore_active flag moved to separate function (#3481)

v2.5.4 2017-02-22
=================

Expand Down Expand Up @@ -298,6 +398,48 @@ v2.5.0 2015-12-17

Cancelled release

v2.4.6 2017-02-22
=================

* Use the url_for() helper for datapusher URLs (#2866)
* Resource creation date use datetime.utcnow() (#3447)
* Fix locale error when using fix ckan.root_path
* `render_markdown` breaks links with ampersands
* Check group name and id during package creation
* Use utcnow() on dashboard_mark_activities_old (#3373)
* Fix encoding error on DataStore exception
* Datastore doesn't add site_url to resource created via API (#3189)
* Fix memberships after user deletion (#3265)
* Remove idle database connection (#3260)
* Fix package_owner_org_update action when called via the API (#2661)

v2.4.8 2017-08-02
=================

* Fix in organization / group form image URL field (#3661)
* Fix activity test to use utcnow (#3644)
* Changed required permission from 'update' to 'manage_group' (#3631)
* Catch invalid sort param exception (#3630)
* Choose direction of recreated package relationship depending on its type (#3626)
* Fix render_datetime for dates before year 1900 (#3611)
* Fix KeyError in 'package_create' (#3027)
* Allow slug preview to work with autocomplete fields (#2501)
* Fix filter results button not working for organization/group (#3620)
* Allow underscores in URL slug preview on create dataset (#3612)
* Create new resource view if resource format changed (#3515)
* Fixed incorrect escaping in `mail_to`
* Autocomplete fields are more responsive - 300ms timeout instead of 1s (#3693)
* Fixed dataset count display for groups (#3711)
* Restrict access to form pages (#3684)

v2.4.7 2017-03-22
=================

* Use fully qualified urls for reset emails (#3486)
* Fix edit_resource for resource with draft state (#3480)
* Tag fix for group/organization pages (#3460)
* Fix for package_search context (#3489)

v2.4.6 2017-02-22
=================

Expand Down
9 changes: 9 additions & 0 deletions ckan/config/middleware/__init__.py
Expand Up @@ -41,6 +41,10 @@ def custom_charset__set(self, charset):

# End of webob.requests.BaseRequest monkey patch

# This is a test Flask request context to be used internally.
# Do not use it!
_internal_test_request_context = None


def make_app(conf, full_stack=True, static_files=True, **app_conf):
'''
Expand All @@ -57,6 +61,11 @@ def make_app(conf, full_stack=True, static_files=True, **app_conf):
app = AskAppDispatcherMiddleware({'pylons_app': pylons_app,
'flask_app': flask_app})

# Set this internal test request context with the configured environment so
# it can be used when calling url_for from tests
global _internal_test_request_context
_internal_test_request_context = flask_app._wsgi_app.test_request_context()

return app


Expand Down
10 changes: 4 additions & 6 deletions ckan/config/routing.py
Expand Up @@ -330,8 +330,6 @@ def make_map():
map.redirect('/user/', '/user')
with SubMapper(map, controller='user') as m:
m.connect('/user/edit', action='edit')
# Note: openid users have slashes in their ids, so need the wildcard
# in the route.
m.connect('user_generate_apikey', '/user/generate_key/{id}', action='generate_apikey')
m.connect('/user/activity/{id}/{offset}', action='activity')
m.connect('user_activity_stream', '/user/activity/{id}',
Expand All @@ -347,12 +345,12 @@ def make_map():
m.connect('/dashboard/{offset}', action='dashboard')
m.connect('user_follow', '/user/follow/{id}', action='follow')
m.connect('/user/unfollow/{id}', action='unfollow')
m.connect('user_followers', '/user/followers/{id:.*}',
m.connect('user_followers', '/user/followers/{id}',
action='followers', ckan_icon='users')
m.connect('user_edit', '/user/edit/{id:.*}', action='edit',
m.connect('user_edit', '/user/edit/{id}', action='edit',
ckan_icon='cog')
m.connect('user_delete', '/user/delete/{id}', action='delete')
m.connect('/user/reset/{id:.*}', action='perform_reset')
m.connect('/user/reset/{id}', action='perform_reset')
m.connect('register', '/user/register', action='register')
m.connect('login', '/user/login', action='login')
m.connect('/user/_logout', action='logout')
Expand All @@ -362,7 +360,7 @@ def make_map():
m.connect('/user/reset', action='request_reset')
m.connect('/user/me', action='me')
m.connect('/user/set_lang/{lang}', action='set_lang')
m.connect('user_datasets', '/user/{id:.*}', action='read',
m.connect('user_datasets', '/user/{id}', action='read',
ckan_icon='sitemap')
m.connect('user_index', '/user', action='index')

Expand Down
9 changes: 4 additions & 5 deletions ckan/controllers/user.py
Expand Up @@ -397,8 +397,7 @@ def login(self, error=None):
if not c.user:
came_from = request.params.get('came_from')
if not came_from:
came_from = h.url_for(controller='user', action='logged_in',
__ckan_no_root=True)
came_from = h.url_for(controller='user', action='logged_in')
c.login_handler = h.url_for(
self._get_repoze_handler('login_handler_path'),
came_from=came_from)
Expand Down Expand Up @@ -436,10 +435,9 @@ def logout(self):
# Do any plugin logout stuff
for item in p.PluginImplementations(p.IAuthenticator):
item.logout()
url = h.url_for(controller='user', action='logged_out_page',
__ckan_no_root=True)
url = h.url_for(controller='user', action='logged_out_page')
h.redirect_to(self._get_repoze_handler('logout_handler_path') +
'?came_from=' + url)
'?came_from=' + url, parse_url=True)

def logged_out(self):
# redirect if needed
Expand Down Expand Up @@ -533,6 +531,7 @@ def perform_reset(self, id):
context['reset_password'] = True
user_state = user_dict['state']
new_password = self._get_form_password()
user_dict['password'] = new_password
username = request.params.get('name')
if (username is not None and username != ''):
user_dict['name'] = username
Expand Down
Binary file modified ckan/i18n/ar/LC_MESSAGES/ckan.mo
Binary file not shown.

0 comments on commit 97bbcdc

Please sign in to comment.