Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-v2.5.6' into canada-v2.5
Browse files Browse the repository at this point in the history
Conflicts:
	ckan/controllers/group.py
	ckan/lib/helpers.py
	ckan/logic/action/delete.py
	ckan/templates/snippets/language_selector.html
  • Loading branch information
wardi committed Sep 11, 2017
2 parents c36bcaf + 3b1c6c8 commit 1ed2d84
Show file tree
Hide file tree
Showing 99 changed files with 850 additions and 230 deletions.
5 changes: 1 addition & 4 deletions .tx/config
Expand Up @@ -5,9 +5,6 @@ host = https://www.transifex.com
file_filter = ckan/i18n/<lang>/LC_MESSAGES/ckan.po
source_file = ckan/i18n/ckan.pot
source_lang = en
trans.sr@latin = ckan/i18n/sr_Latn/LC_MESSAGES/ckan.po
type = PO

# Namings not quite the same in Transifex and babel:
# Transifex vs Babel (& CKAN)
# 'sr@Latin' vs 'sr_Latn'
trans.sr@latin = ckan/i18n/sr_Latn/LC_MESSAGES/ckan.po
60 changes: 60 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -7,6 +7,51 @@
Changelog
---------

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
=================


* Fix DataPusher being fired multiple times (#3245)
* 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.5.3 2016-11-02
=================

Expand Down Expand Up @@ -108,6 +153,21 @@ v2.5.0 2015-12-17

Cancelled release

v2.4.5 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.4 2016-11-02
=================

Expand Down
2 changes: 1 addition & 1 deletion ckan/__init__.py
@@ -1,4 +1,4 @@
__version__ = '2.5.3'
__version__ = '2.5.6'

__description__ = 'CKAN Software'
__long_description__ = \
Expand Down
5 changes: 5 additions & 0 deletions ckan/config/environment.py
Expand Up @@ -236,6 +236,11 @@ def genshi_lookup_attr(cls, obj, key):
# load all CKAN plugins
p.load_all(config)

# issue #3260: remove idle transaction
# Session that was used for getting all config params nor committed,
# neither removed and we have idle connection as result
model.Session.commit()


# A mapping of config settings that can be overridden by env vars.
# Note: Do not remove the following lines, they are used in the docs
Expand Down
49 changes: 35 additions & 14 deletions ckan/controllers/group.py
Expand Up @@ -168,14 +168,24 @@ def index(self):
context['user_id'] = c.userobj.id
context['user_is_admin'] = c.userobj.sysadmin

data_dict_global_results = {
'all_fields': False,
'q': q,
'sort': sort_by,
'type': group_type or 'group',
}
global_results = self._action('group_list')(context,
data_dict_global_results)
try:
data_dict_global_results = {
'all_fields': False,
'q': q,
'sort': sort_by,
'type': group_type or 'group',
}
global_results = self._action('group_list')(
context, data_dict_global_results)
except ValidationError as e:
if e.error_dict and e.error_dict.get('message'):
msg = e.error_dict['message']
else:
msg = str(e)
h.flash_error(msg)
c.page = h.Page([], 0)
return render(self._index_template(group_type),
extra_vars={'group_type': group_type})

data_dict_page_results = {
'all_fields': True,
Expand Down Expand Up @@ -274,8 +284,9 @@ def drill_down_url(**by):
c.drill_down_url = drill_down_url

def remove_field(key, value=None, replace=None):
controller = lookup_group_controller(group_type)
return h.remove_url_param(key, value=value, replace=replace,
controller='group', action='read',
controller=controller, action='read',
extras=dict(id=c.group_dict.get('name')))

c.remove_field = remove_field
Expand Down Expand Up @@ -435,6 +446,7 @@ def bulk_process(self, id):
data_dict = {'id': id}

try:
self._check_access('bulk_update_public', context, {'org_id': id})
# Do not query for the group datasets when dictizing, as they will
# be ignored and get requested on the controller anyway
data_dict['include_datasets'] = False
Expand All @@ -443,7 +455,7 @@ def bulk_process(self, id):
except NotFound:
abort(404, _('Group not found'))
except NotAuthorized:
abort(401, _('Unauthorized to read group %s') % id)
abort(403, _('User %r not authorized to edit %s') % (c.user, id))

#use different form names so that ie7 can be detected
form_names = set(["bulk_action.public", "bulk_action.delete",
Expand Down Expand Up @@ -703,16 +715,21 @@ def members(self, id):
'user': c.user or c.author}

try:
data_dict = {'id': id}
check_access('group_edit_permissions', context, data_dict)
c.members = self._action('member_list')(
context, {'id': id, 'object_type': 'user'}
)
data_dict = {'id': id}
data_dict['include_datasets'] = False
c.group_dict = self._action('group_show')(context, data_dict)
except NotAuthorized:
abort(401, _('Unauthorized to delete group %s') % '')
except NotFound:
abort(404, _('Group not found'))
except NotAuthorized:
abort(
403,
_('User %r not authorized to edit members of %s') % (
c.user, id))

return self._render_template('group/members.html', group_type)

def member_new(self, id):
Expand All @@ -721,7 +738,11 @@ def member_new(self, id):
context = {'model': model, 'session': model.Session,
'user': c.user or c.author}

#self._check_access('group_delete', context, {'id': id})
try:
self._check_access('group_member_create', context, {'id': id})
except NotAuthorized:
abort(403, _('Unauthorized to create group %s members') % '')

try:
data_dict = {'id': id}
data_dict['include_datasets'] = False
Expand Down
16 changes: 9 additions & 7 deletions ckan/controllers/package.py
Expand Up @@ -518,6 +518,15 @@ def new(self, data=None, errors=None, error_summary=None):

def resource_edit(self, id, resource_id, data=None, errors=None,
error_summary=None):
context = {'model': model, 'session': model.Session,
'api_version': 3, 'for_edit': True,
'user': c.user, 'auth_user_obj': c.userobj}
data_dict = {'id': id}

try:
check_access('package_update', context, data_dict)
except NotAuthorized:
abort(403, _('User %r not authorized to edit %s') % (c.user, id))

if request.method == 'POST' and not data:
data = data or \
Expand All @@ -526,10 +535,6 @@ def resource_edit(self, id, resource_id, data=None, errors=None,
# we don't want to include save as it is part of the form
del data['save']

context = {'model': model, 'session': model.Session,
'api_version': 3, 'for_edit': True,
'user': c.user or c.author, 'auth_user_obj': c.userobj}

data['package_id'] = id
try:
if resource_id:
Expand All @@ -547,9 +552,6 @@ def resource_edit(self, id, resource_id, data=None, errors=None,
redirect(h.url_for(controller='package', action='resource_read',
id=id, resource_id=resource_id))

context = {'model': model, 'session': model.Session,
'api_version': 3, 'for_edit': True,
'user': c.user or c.author, 'auth_user_obj': c.userobj}
pkg_dict = get_action('package_show')(context, {'id': id})
if pkg_dict['state'].startswith('draft'):
# dataset has not yet been fully created
Expand Down
2 changes: 1 addition & 1 deletion ckan/controllers/util.py
Expand Up @@ -15,7 +15,7 @@ def redirect(self):
if not url:
base.abort(400, _('Missing Value') + ': url')

if h.url_is_local(url):
if h.url_is_local(url) and '\r' not in url and '\n' not in url:
return base.redirect(url)
else:
base.abort(403, _('Redirecting to external site is not allowed.'))
Expand Down
2 changes: 1 addition & 1 deletion ckan/i18n/ar/LC_MESSAGES/ckan.po
Expand Up @@ -10,7 +10,7 @@ msgstr ""
"Project-Id-Version: CKAN\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-11-26 13:42+0000\n"
"PO-Revision-Date: 2015-11-26 14:18+0000\n"
"PO-Revision-Date: 2017-07-26 08:22+0000\n"
"Last-Translator: dread <david.read@hackneyworkshop.com>\n"
"Language-Team: Arabic (http://www.transifex.com/okfn/ckan/language/ar/)\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 1 addition & 1 deletion ckan/i18n/bg/LC_MESSAGES/ckan.po
Expand Up @@ -20,7 +20,7 @@ msgstr ""
"Project-Id-Version: CKAN\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-11-26 13:42+0000\n"
"PO-Revision-Date: 2015-11-26 14:23+0000\n"
"PO-Revision-Date: 2017-07-26 08:22+0000\n"
"Last-Translator: dread <david.read@hackneyworkshop.com>\n"
"Language-Team: Bulgarian (http://www.transifex.com/okfn/ckan/language/bg/)\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 1 addition & 1 deletion ckan/i18n/ca/LC_MESSAGES/ckan.po
Expand Up @@ -11,7 +11,7 @@ msgstr ""
"Project-Id-Version: CKAN\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-11-26 13:42+0000\n"
"PO-Revision-Date: 2015-12-04 10:58+0000\n"
"PO-Revision-Date: 2017-07-26 08:22+0000\n"
"Last-Translator: Adrià Mercader <adria.mercader@okfn.org>\n"
"Language-Team: Catalan (http://www.transifex.com/okfn/ckan/language/ca/)\n"
"MIME-Version: 1.0\n"
Expand Down
8 changes: 4 additions & 4 deletions ckan/i18n/cs_CZ/LC_MESSAGES/ckan.po
Expand Up @@ -4,16 +4,16 @@
#
# Translators:
# Adrià Mercader <adria.mercader@okfn.org>, 2013
# klimek <klimek@ksi.mff.cuni.cz>, 2011,2015
# klimek <klimek@ksi.mff.cuni.cz>, 2015
# Jakub Klímek <klimek@ksi.mff.cuni.cz>, 2011,2015
# Jakub Klímek <klimek@ksi.mff.cuni.cz>, 2015
# uep, 2011
msgid ""
msgstr ""
"Project-Id-Version: CKAN\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-11-26 13:42+0000\n"
"PO-Revision-Date: 2015-12-04 11:38+0000\n"
"Last-Translator: klimek <klimek@ksi.mff.cuni.cz>\n"
"PO-Revision-Date: 2017-07-26 08:22+0000\n"
"Last-Translator: Jakub Klímek <klimek@ksi.mff.cuni.cz>\n"
"Language-Team: Czech (Czech Republic) (http://www.transifex.com/okfn/ckan/language/cs_CZ/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down
2 changes: 1 addition & 1 deletion ckan/i18n/da_DK/LC_MESSAGES/ckan.po
Expand Up @@ -15,7 +15,7 @@ msgstr ""
"Project-Id-Version: CKAN\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-11-26 13:42+0000\n"
"PO-Revision-Date: 2015-11-26 14:23+0000\n"
"PO-Revision-Date: 2017-07-26 08:22+0000\n"
"Last-Translator: dread <david.read@hackneyworkshop.com>\n"
"Language-Team: Danish (Denmark) (http://www.transifex.com/okfn/ckan/language/da_DK/)\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 1 addition & 1 deletion ckan/i18n/de/LC_MESSAGES/ckan.po
Expand Up @@ -25,7 +25,7 @@ msgstr ""
"Project-Id-Version: CKAN\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-11-26 13:42+0000\n"
"PO-Revision-Date: 2015-12-10 07:53+0000\n"
"PO-Revision-Date: 2017-07-26 08:22+0000\n"
"Last-Translator: Florian Mayer <Florian.Mayer@dpaw.wa.gov.au>\n"
"Language-Team: German (http://www.transifex.com/okfn/ckan/language/de/)\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 1 addition & 1 deletion ckan/i18n/el/LC_MESSAGES/ckan.po
Expand Up @@ -24,7 +24,7 @@ msgstr ""
"Project-Id-Version: CKAN\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-11-26 13:42+0000\n"
"PO-Revision-Date: 2015-11-26 14:11+0000\n"
"PO-Revision-Date: 2017-07-26 08:22+0000\n"
"Last-Translator: dread <david.read@hackneyworkshop.com>\n"
"Language-Team: Greek (http://www.transifex.com/okfn/ckan/language/el/)\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 1 addition & 1 deletion ckan/i18n/en_AU/LC_MESSAGES/ckan.po
Expand Up @@ -12,7 +12,7 @@ msgstr ""
"Project-Id-Version: CKAN\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-11-26 13:42+0000\n"
"PO-Revision-Date: 2015-11-26 21:50+0000\n"
"PO-Revision-Date: 2017-07-26 08:22+0000\n"
"Last-Translator: Steven De Costa <steven.decosta@linkdigital.com.au>\n"
"Language-Team: English (Australia) (http://www.transifex.com/okfn/ckan/language/en_AU/)\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 1 addition & 1 deletion ckan/i18n/en_GB/LC_MESSAGES/ckan.po
Expand Up @@ -14,7 +14,7 @@ msgstr ""
"Project-Id-Version: CKAN\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-11-26 13:42+0000\n"
"PO-Revision-Date: 2016-05-27 15:38+0000\n"
"PO-Revision-Date: 2017-07-26 08:22+0000\n"
"Last-Translator: Martin Burchell <martinb-tfx@aptivate.org>\n"
"Language-Team: English (United Kingdom) (http://www.transifex.com/okfn/ckan/language/en_GB/)\n"
"MIME-Version: 1.0\n"
Expand Down
4 changes: 2 additions & 2 deletions ckan/i18n/es/LC_MESSAGES/ckan.po
Expand Up @@ -8,7 +8,7 @@
# Félix Pedrera <felix.pedrera@gmail.com>, 2012
# <internet@davidread.org>, 2011
# Isabel Ruiz, 2013
# javierdcm <javierdcm@gmail.com>, 2012
# J <javierdcm@gmail.com>, 2012
# Jesús García <>, 2012
# Jesus Redondo <jesusredondo@unex.es>, 2013
# Open Knowledge Foundation <translations@okfn.org>, 2011
Expand All @@ -18,7 +18,7 @@ msgstr ""
"Project-Id-Version: CKAN\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-11-26 13:42+0000\n"
"PO-Revision-Date: 2015-12-06 19:52+0000\n"
"PO-Revision-Date: 2017-07-26 08:22+0000\n"
"Last-Translator: Carlos Brys <brys@misiones.gov.ar>\n"
"Language-Team: Spanish (http://www.transifex.com/okfn/ckan/language/es/)\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 1 addition & 1 deletion ckan/i18n/es_AR/LC_MESSAGES/ckan.po
Expand Up @@ -11,7 +11,7 @@ msgstr ""
"Project-Id-Version: CKAN\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-11-26 13:42+0000\n"
"PO-Revision-Date: 2015-12-10 14:30+0000\n"
"PO-Revision-Date: 2017-07-26 08:22+0000\n"
"Last-Translator: Carlos Brys <brys@misiones.gov.ar>\n"
"Language-Team: Spanish (Argentina) (http://www.transifex.com/okfn/ckan/language/es_AR/)\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 1 addition & 1 deletion ckan/i18n/fa_IR/LC_MESSAGES/ckan.po
Expand Up @@ -14,7 +14,7 @@ msgstr ""
"Project-Id-Version: CKAN\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-11-26 13:42+0000\n"
"PO-Revision-Date: 2015-11-26 14:20+0000\n"
"PO-Revision-Date: 2017-07-26 08:22+0000\n"
"Last-Translator: dread <david.read@hackneyworkshop.com>\n"
"Language-Team: Persian (Iran) (http://www.transifex.com/okfn/ckan/language/fa_IR/)\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 1 addition & 1 deletion ckan/i18n/fi/LC_MESSAGES/ckan.po
Expand Up @@ -21,7 +21,7 @@ msgstr ""
"Project-Id-Version: CKAN\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-11-26 13:42+0000\n"
"PO-Revision-Date: 2016-05-26 12:31+0000\n"
"PO-Revision-Date: 2017-07-26 08:22+0000\n"
"Last-Translator: Zharktas <jari-pekka.voutilainen@gofore.com>\n"
"Language-Team: Finnish (http://www.transifex.com/okfn/ckan/language/fi/)\n"
"MIME-Version: 1.0\n"
Expand Down

0 comments on commit 1ed2d84

Please sign in to comment.