[ckan-changes] [ckan/ckan] e9adf7: Fix resource.url being saved as "___"

Sergey noreply at github.com
Thu Jan 16 18:57:25 UTC 2020


  Branch: refs/heads/master
  Home:   https://github.com/ckan/ckan
  Commit: e9adf793e5eb3989e23b9c152d5898bb1adb015d
      https://github.com/ckan/ckan/commit/e9adf793e5eb3989e23b9c152d5898bb1adb015d
  Author: David Read <david.read at hackneyworkshop.com>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M ckan/lib/uploader.py
    M ckan/tests/controllers/test_package.py
    A ckan/tests/lib/test_uploader.py

  Log Message:
  -----------
  Fix resource.url being saved as "___"

Fixes #5031

werkzeug upgrade 0.14 to 0.15 means that when you submit the resource form with a resource url (not an upload), and the uploader is enabled, then the 'upload' parameter value changes from being u'' to: FileStorage(filename=u''). This half-confused ResourceUpload into thinking that it should upload something and it stored the url as '___' (!). This is fixed by essentially testing bool(resource['upload']) because bool(FileStorage(filename=u'')) == False.

I was unable to test this using webtest - it didn't submit the form like my real browser does. So I just add a test for ResourceUpload that shows the issue and prevents it regressing in future.


  Commit: 697d407934e90747bbf87a8fce80d4c93db95b94
      https://github.com/ckan/ckan/commit/697d407934e90747bbf87a8fce80d4c93db95b94
  Author: amercader <amercadero at gmail.com>
  Date:   2020-01-10 (Fri, 10 Jan 2020)

  Changed paths:
    M .circleci/config.yml
    M .travis.yml
    M Dockerfile
    A SECURITY.md
    M bin/travis-install-dependencies
    M ckan/authz.py
    M ckan/cli/__init__.py
    M ckan/cli/cli.py
    M ckan/cli/dataset.py
    M ckan/cli/datastore.py
    A ckan/cli/front_end_build.py
    M ckan/cli/generate.py
    A ckan/cli/jobs.py
    A ckan/cli/profile.py
    A ckan/cli/sysadmin.py
    M ckan/cli/translation.py
    A ckan/cli/user.py
    A ckan/cli/views.py
    M ckan/common.py
    M ckan/config/deployment.ini_tmpl
    M ckan/config/environment.py
    M ckan/config/middleware/__init__.py
    M ckan/config/middleware/common_middleware.py
    M ckan/config/middleware/flask_app.py
    M ckan/config/resource_formats.json
    M ckan/config/routing.py
    M ckan/controllers/admin.py
    M ckan/controllers/api.py
    M ckan/controllers/error.py
    M ckan/controllers/package.py
    R ckan/controllers/template.py
    M ckan/i18n/check_po_files.py
    M ckan/include/rjsmin.py
    R ckan/lib/activity_streams_session_extension.py
    M ckan/lib/app_globals.py
    M ckan/lib/authenticator.py
    M ckan/lib/base.py
    M ckan/lib/changes.py
    M ckan/lib/cli.py
    M ckan/lib/config_tool.py
    M ckan/lib/create_test_data.py
    M ckan/lib/dictization/__init__.py
    M ckan/lib/dictization/model_dictize.py
    M ckan/lib/dictization/model_save.py
    M ckan/lib/fanstatic_resources.py
    M ckan/lib/helpers.py
    M ckan/lib/i18n.py
    M ckan/lib/jinja_extensions.py
    M ckan/lib/lazyjson.py
    M ckan/lib/mailer.py
    M ckan/lib/navl/dictization_functions.py
    M ckan/lib/navl/validators.py
    A ckan/lib/pagination.py
    M ckan/lib/redis.py
    M ckan/lib/repoze_plugins/friendly_form.py
    M ckan/lib/search/__init__.py
    M ckan/lib/search/index.py
    M ckan/lib/uploader.py
    M ckan/lib/webassets_tools.py
    M ckan/logic/__init__.py
    M ckan/logic/action/__init__.py
    M ckan/logic/action/create.py
    M ckan/logic/action/delete.py
    M ckan/logic/action/get.py
    M ckan/logic/action/update.py
    M ckan/logic/auth/get.py
    M ckan/logic/converters.py
    M ckan/logic/schema.py
    M ckan/logic/validators.py
    M ckan/migration/env.py
    M ckan/migration/migrate_package_activity.py
    M ckan/migration/revision_legacy_code.py
    A ckan/migration/versions/093_7f70d7d15445_remove_activity_revision_id.py
    M ckan/model/__init__.py
    M ckan/model/activity.py
    M ckan/model/core.py
    M ckan/model/dashboard.py
    M ckan/model/domain_object.py
    M ckan/model/follower.py
    M ckan/model/group.py
    M ckan/model/group_extra.py
    M ckan/model/license.py
    M ckan/model/meta.py
    M ckan/model/package.py
    M ckan/model/package_extra.py
    M ckan/model/package_relationship.py
    M ckan/model/rating.py
    M ckan/model/resource.py
    M ckan/model/resource_view.py
    R ckan/model/revision.py
    A ckan/model/system.py
    M ckan/model/system_info.py
    M ckan/model/tag.py
    M ckan/model/task_status.py
    M ckan/model/term_translation.py
    M ckan/model/tracking.py
    M ckan/model/types.py
    M ckan/model/user.py
    M ckan/model/vocabulary.py
    M ckan/pastertemplates/template/README.rst_tmpl
    M ckan/pastertemplates/template/bin/travis-run.sh_tmpl
    M ckan/plugins/__init__.py
    M ckan/plugins/core.py
    M ckan/plugins/interfaces.py
    M ckan/plugins/toolkit.py
    A ckan/plugins/toolkit.py.orig
    M ckan/public/base/css/fuchsia.css
    M ckan/public/base/css/green.css
    M ckan/public/base/css/main-rtl.css
    M ckan/public/base/css/main.css
    M ckan/public/base/css/maroon.css
    M ckan/public/base/css/red.css
    M ckan/public/base/javascript/client.js
    M ckan/public/base/javascript/modules/autocomplete.js
    M ckan/public/base/javascript/modules/popover-context.js
    M ckan/public/base/less/dataset.less
    A ckan/public/robots.txt
    M ckan/templates/error_document_template.html
    M ckan/templates/package/snippets/additional_info.html
    M ckan/templates/page.html
    R ckan/templates/robots.txt
    M ckan/templates/snippets/additional_info.html
    M ckan/templates/snippets/context.html
    M ckan/templates/snippets/context/user.html
    M ckan/templates/snippets/follow_button.html
    M ckan/templates/user/edit_user_form.html
    M ckan/templates/user/read_base.html
    M ckan/tests/config/test_environment.py
    M ckan/tests/config/test_middleware.py
    M ckan/tests/config/test_sessions.py
    M ckan/tests/controllers/__init__.py
    M ckan/tests/controllers/test_admin.py
    M ckan/tests/controllers/test_api.py
    M ckan/tests/controllers/test_feed.py
    M ckan/tests/controllers/test_group.py
    M ckan/tests/controllers/test_home.py
    M ckan/tests/controllers/test_organization.py
    M ckan/tests/controllers/test_package.py
    R ckan/tests/controllers/test_template.py
    M ckan/tests/controllers/test_user.py
    M ckan/tests/controllers/test_util.py
    M ckan/tests/factories.py
    M ckan/tests/helpers.py
    M ckan/tests/i18n/test_check_po_files.py
    M ckan/tests/legacy/__init__.py
    M ckan/tests/legacy/ckantestplugins.py
    M ckan/tests/legacy/functional/api/__init__.py
    M ckan/tests/legacy/functional/api/base.py
    M ckan/tests/legacy/functional/api/model/test_group.py
    R ckan/tests/legacy/functional/api/model/test_package.py
    R ckan/tests/legacy/functional/api/model/test_ratings.py
    R ckan/tests/legacy/functional/api/model/test_tag.py
    M ckan/tests/legacy/functional/api/model/test_vocabulary.py
    M ckan/tests/legacy/functional/api/test_api.py
    M ckan/tests/legacy/functional/api/test_email_notifications.py
    M ckan/tests/legacy/functional/api/test_follow.py
    M ckan/tests/legacy/functional/api/test_package_search.py
    M ckan/tests/legacy/functional/api/test_resource.py
    R ckan/tests/legacy/functional/api/test_resource_search.py
    M ckan/tests/legacy/functional/api/test_user.py
    R ckan/tests/legacy/functional/api/test_util.py
    M ckan/tests/legacy/functional/base.py
    M ckan/tests/legacy/functional/test_admin.py
    R ckan/tests/legacy/functional/test_error.py
    M ckan/tests/legacy/functional/test_group.py
    M ckan/tests/legacy/functional/test_package.py
    M ckan/tests/legacy/functional/test_pagination.py
    M ckan/tests/legacy/functional/test_preview_interface.py
    M ckan/tests/legacy/functional/test_tag.py
    M ckan/tests/legacy/functional/test_tracking.py
    M ckan/tests/legacy/functional/test_user.py
    M ckan/tests/legacy/html_check.py
    M ckan/tests/legacy/lib/__init__.py
    M ckan/tests/legacy/lib/test_authenticator.py
    M ckan/tests/legacy/lib/test_cli.py
    M ckan/tests/legacy/lib/test_dictization.py
    M ckan/tests/legacy/lib/test_dictization_schema.py
    M ckan/tests/legacy/lib/test_email_notifications.py
    M ckan/tests/legacy/lib/test_hash.py
    M ckan/tests/legacy/lib/test_helpers.py
    M ckan/tests/legacy/lib/test_navl.py
    M ckan/tests/legacy/lib/test_resource_search.py
    M ckan/tests/legacy/lib/test_solr_package_search.py
    M ckan/tests/legacy/lib/test_solr_package_search_synchronous_update.py
    M ckan/tests/legacy/lib/test_solr_schema_version.py
    M ckan/tests/legacy/lib/test_solr_search_index.py
    M ckan/tests/legacy/lib/test_tag_search.py
    M ckan/tests/legacy/logic/test_action.py
    M ckan/tests/legacy/logic/test_auth.py
    M ckan/tests/legacy/logic/test_init.py
    M ckan/tests/legacy/logic/test_member.py
    M ckan/tests/legacy/logic/test_tag.py
    M ckan/tests/legacy/logic/test_tag_vocab.py
    M ckan/tests/legacy/logic/test_validators.py
    M ckan/tests/legacy/misc/test_mock_mail_server.py
    M ckan/tests/legacy/mock_mail_server.py
    M ckan/tests/legacy/mock_plugin.py
    M ckan/tests/legacy/models/test_follower.py
    M ckan/tests/legacy/models/test_group.py
    M ckan/tests/legacy/models/test_misc.py
    M ckan/tests/legacy/models/test_package.py
    M ckan/tests/legacy/models/test_package_relationships.py
    R ckan/tests/legacy/models/test_purge_revision.py
    M ckan/tests/legacy/models/test_resource.py
    R ckan/tests/legacy/models/test_revision.py
    M ckan/tests/legacy/models/test_user.py
    M ckan/tests/legacy/schema/test_schema.py
    M ckan/tests/legacy/test_coding_standards.py
    M ckan/tests/legacy/test_plugins.py
    R ckan/tests/legacy/test_versions.py
    M ckan/tests/lib/__init__.py
    M ckan/tests/lib/dictization/test_model_dictize.py
    M ckan/tests/lib/navl/test_dictization_functions.py
    M ckan/tests/lib/navl/test_validators.py
    M ckan/tests/lib/search/test_index.py
    M ckan/tests/lib/test_app_globals.py
    M ckan/tests/lib/test_auth_tkt.py
    M ckan/tests/lib/test_base.py
    M ckan/tests/lib/test_changes.py
    M ckan/tests/lib/test_cli.py
    M ckan/tests/lib/test_config_tool.py
    M ckan/tests/lib/test_datapreview.py
    M ckan/tests/lib/test_helpers.py
    M ckan/tests/lib/test_i18n.py
    M ckan/tests/lib/test_io.py
    M ckan/tests/lib/test_jobs.py
    M ckan/tests/lib/test_mailer.py
    M ckan/tests/lib/test_munge.py
    R ckan/tests/lib/test_navl.py
    M ckan/tests/logic/action/__init__.py
    M ckan/tests/logic/action/test_create.py
    M ckan/tests/logic/action/test_delete.py
    M ckan/tests/logic/action/test_get.py
    M ckan/tests/logic/action/test_patch.py
    M ckan/tests/logic/action/test_update.py
    M ckan/tests/logic/auth/__init__.py
    M ckan/tests/logic/auth/test_create.py
    M ckan/tests/logic/auth/test_delete.py
    M ckan/tests/logic/auth/test_get.py
    M ckan/tests/logic/auth/test_init.py
    M ckan/tests/logic/auth/test_update.py
    M ckan/tests/logic/test_conversion.py
    M ckan/tests/logic/test_converters.py
    M ckan/tests/logic/test_schema.py
    M ckan/tests/logic/test_validators.py
    M ckan/tests/migration/__init__.py
    R ckan/tests/migration/test_migrate_package_activity.py
    R ckan/tests/migration/test_revision_legacy_code.py
    M ckan/tests/model/__init__.py
    M ckan/tests/model/test_license.py
    M ckan/tests/model/test_package.py
    M ckan/tests/model/test_package_extra.py
    M ckan/tests/model/test_resource.py
    M ckan/tests/model/test_resource_view.py
    M ckan/tests/model/test_system_info.py
    M ckan/tests/model/test_tags.py
    M ckan/tests/model/test_user.py
    M ckan/tests/plugins/__init__.py
    M ckan/tests/plugins/test_toolkit.py
    A ckan/tests/pytest_ckan/__init__.py
    A ckan/tests/pytest_ckan/ckan_setup.py
    A ckan/tests/pytest_ckan/fixtures.py
    A ckan/tests/pytest_ckan/test_fixtures.py
    M ckan/tests/test_authz.py
    M ckan/tests/test_coding_standards.py
    M ckan/tests/test_common.py
    M ckan/tests/test_factories.py
    M ckan/tests/test_none_root.py
    M ckan/tests/test_robots_txt.py
    M ckan/views/__init__.py
    M ckan/views/admin.py
    M ckan/views/api.py
    M ckan/views/dataset.py
    M ckan/views/feed.py
    M ckan/views/group.py
    M ckan/views/home.py
    M ckan/views/resource.py
    M ckan/views/user.py
    M ckanext/datapusher/logic/schema.py
    M ckanext/datapusher/tests/test.py
    M ckanext/datapusher/tests/test_action.py
    M ckanext/datapusher/tests/test_controller.py
    M ckanext/datapusher/tests/test_default_views.py
    M ckanext/datapusher/tests/test_interfaces.py
    M ckanext/datastore/backend/postgres.py
    A ckanext/datastore/blueprint.py
    M ckanext/datastore/commands.py
    R ckanext/datastore/controller.py
    M ckanext/datastore/logic/action.py
    M ckanext/datastore/logic/schema.py
    M ckanext/datastore/plugin.py
    A ckanext/datastore/tests/conftest.py
    M ckanext/datastore/tests/helpers.py
    M ckanext/datastore/tests/sample_datastore_plugin.py
    M ckanext/datastore/tests/test_chained_action.py
    M ckanext/datastore/tests/test_chained_auth_functions.py
    M ckanext/datastore/tests/test_create.py
    M ckanext/datastore/tests/test_db.py
    M ckanext/datastore/tests/test_delete.py
    M ckanext/datastore/tests/test_dictionary.py
    M ckanext/datastore/tests/test_disable.py
    M ckanext/datastore/tests/test_dump.py
    M ckanext/datastore/tests/test_helpers.py
    M ckanext/datastore/tests/test_info.py
    M ckanext/datastore/tests/test_interface.py
    M ckanext/datastore/tests/test_plugin.py
    M ckanext/datastore/tests/test_search.py
    M ckanext/datastore/tests/test_unit.py
    M ckanext/datastore/tests/test_upsert.py
    R ckanext/datastore/view.py
    M ckanext/example_flask_iblueprint/tests/test_routes.py
    M ckanext/example_flask_streaming/tests/test_streaming_responses.py
    M ckanext/example_iauthfunctions/tests/test_example_iauthfunctions.py
    A ckanext/example_iclick/__init__.py
    A ckanext/example_iclick/cli.py
    A ckanext/example_iclick/plugin.py
    M ckanext/example_iconfigurer/tests/test_example_iconfigurer.py
    M ckanext/example_iconfigurer/tests/test_iconfigurer_toolkit.py
    M ckanext/example_iconfigurer/tests/test_iconfigurer_update_config.py
    M ckanext/example_idatasetform/tests/test_controllers.py
    M ckanext/example_idatasetform/tests/test_example_idatasetform.py
    M ckanext/example_idatastorebackend/example_sqlite.py
    M ckanext/example_idatastorebackend/test/test_plugin.py
    M ckanext/example_igroupform/tests/test_controllers.py
    M ckanext/example_ipermissionlabels/tests/test_example_ipermissionlabels.py
    M ckanext/example_itranslation/tests/test_plugin.py
    M ckanext/example_iuploader/test/test_plugin.py
    M ckanext/example_ivalidators/tests/test_ivalidators.py
    M ckanext/example_theme_docs/custom_config_setting/plugin.py
    M ckanext/example_theme_docs/custom_emails/tests.py
    M ckanext/example_theme_docs/v12_extra_public_dir/plugin.py
    M ckanext/example_theme_docs/v15_fanstatic/plugin.py
    M ckanext/example_theme_docs/v22_fanstatic_and_webassets/plugin.py
    M ckanext/imageview/tests/test_view.py
    M ckanext/imageview/theme/templates/image_form.html
    M ckanext/multilingual/plugin.py
    M ckanext/multilingual/solr/schema.xml
    M ckanext/reclineview/plugin.py
    A ckanext/resourceproxy/blueprint.py
    R ckanext/resourceproxy/controller.py
    M ckanext/resourceproxy/plugin.py
    M ckanext/resourceproxy/tests/test_proxy.py
    M ckanext/stats/stats.py
    M ckanext/stats/templates/ckanext/stats/index.html
    M ckanext/stats/tests/test_stats_lib.py
    M ckanext/textview/plugin.py
    M ckanext/textview/tests/test_view.py
    M ckanext/webpageview/tests/test_view.py
    A conftest.py
    M contrib/cookiecutter/ckan_extension/{{cookiecutter.project}}/README.rst
    M contrib/cookiecutter/ckan_extension/{{cookiecutter.project}}/bin/travis-run.sh
    R contrib/docker/docker-cloud.yml
    M dev-requirements.txt
    M doc/contributing/database-migrations.rst
    M doc/contributing/release-process.rst
    M doc/contributing/test.rst
    M doc/contributing/testing.rst
    M doc/extensions/adding-custom-fields.rst
    M doc/extensions/testing-extensions.rst
    M doc/maintaining/configuration.rst
    M doc/maintaining/email-notifications.rst
    M doc/maintaining/getting-started.rst
    M doc/maintaining/installing/install-from-source.rst
    M doc/maintaining/multilingual.rst
    M doc/maintaining/upgrading/index.rst
    A doc/maintaining/upgrading/upgrade-to-python3.rst
    A requirements-py2.in
    A requirements-py2.txt
    M requirements.in
    M requirements.txt
    M scripts/4042_fix_resource_extras.py
    M setup.cfg
    M setup.py

  Log Message:
  -----------
  Merge branch 'master' into 5031-fix-res-url-after-werkzeug-upgrade


  Commit: ebcbdcc20cd64af8aabd03a176a83a572d1493e5
      https://github.com/ckan/ckan/commit/ebcbdcc20cd64af8aabd03a176a83a572d1493e5
  Author: amercader <amercadero at gmail.com>
  Date:   2020-01-10 (Fri, 10 Jan 2020)

  Changed paths:
    M ckan/lib/pagination.py
    M ckan/tests/legacy/__init__.py
    M ckan/tests/legacy/test_coding_standards.py
    M ckan/tests/test_coding_standards.py
    R ckan/websetup.py

  Log Message:
  -----------
  Merge branch 'master' into 5031-fix-res-url-after-werkzeug-upgrade


  Commit: 856a9a1e5e1f2ea6b2094eb4ce8bf56d5c45f833
      https://github.com/ckan/ckan/commit/856a9a1e5e1f2ea6b2094eb4ce8bf56d5c45f833
  Author: amercader <amercadero at gmail.com>
  Date:   2020-01-10 (Fri, 10 Jan 2020)

  Changed paths:
    M ckan/lib/uploader.py

  Log Message:
  -----------
  [#5031] Use bool in upload field check


  Commit: d1553c743da0c54b1a0cdafb44e52880d5c5fa89
      https://github.com/ckan/ckan/commit/d1553c743da0c54b1a0cdafb44e52880d5c5fa89
  Author: amercader <amercadero at gmail.com>
  Date:   2020-01-10 (Fri, 10 Jan 2020)

  Changed paths:
    M ckan/tests/logic/action/test_update.py

  Log Message:
  -----------
  [#5031] Use Werkzeug based fake storage object in tests


  Commit: 6755367836d9090513961752a828715cca4c51f4
      https://github.com/ckan/ckan/commit/6755367836d9090513961752a828715cca4c51f4
  Author: amercader <amercadero at gmail.com>
  Date:   2020-01-10 (Fri, 10 Jan 2020)

  Changed paths:
    M ckan/tests/lib/test_uploader.py

  Log Message:
  -----------
  [#5031] Coding standards


  Commit: eca8887bece5c14eb08f43d4bd527b63b204b2af
      https://github.com/ckan/ckan/commit/eca8887bece5c14eb08f43d4bd527b63b204b2af
  Author: amercader <amercadero at gmail.com>
  Date:   2020-01-10 (Fri, 10 Jan 2020)

  Changed paths:
    M ckan/tests/controllers/test_package.py

  Log Message:
  -----------
  Fix asserts after wrong merge


  Commit: f22f01d989b1b9fd87720140bb13aab3e3a7602c
      https://github.com/ckan/ckan/commit/f22f01d989b1b9fd87720140bb13aab3e3a7602c
  Author: amercader <amercadero at gmail.com>
  Date:   2020-01-10 (Fri, 10 Jan 2020)

  Changed paths:
    M ckan/tests/controllers/test_package.py
    M ckan/tests/logic/action/test_create.py
    M ckan/tests/logic/action/test_update.py

  Log Message:
  -----------
  [#5031] [#5031] More tests fixes


  Commit: e26b3b8bf5bd9f688567d95151fe94cc4184cab4
      https://github.com/ckan/ckan/commit/e26b3b8bf5bd9f688567d95151fe94cc4184cab4
  Author: amercader <amercadero at gmail.com>
  Date:   2020-01-10 (Fri, 10 Jan 2020)

  Changed paths:
    M ckan/tests/logic/action/test_update.py

  Log Message:
  -----------
  [#5031] Fix class reference


  Commit: 4e0227c3db226bf47e5bc7329f88356efbf2abed
      https://github.com/ckan/ckan/commit/4e0227c3db226bf47e5bc7329f88356efbf2abed
  Author: Sergey <tonnydexter at gmail.com>
  Date:   2020-01-16 (Thu, 16 Jan 2020)

  Changed paths:
    M ckan/lib/uploader.py
    M ckan/tests/controllers/test_package.py
    A ckan/tests/lib/test_uploader.py
    M ckan/tests/logic/action/test_create.py
    M ckan/tests/logic/action/test_update.py

  Log Message:
  -----------
  Merge pull request #5032 from ckan/5031-fix-res-url-after-werkzeug-upgrade

Fix resource.url being saved as "___"


Compare: https://github.com/ckan/ckan/compare/3b8e2236101d...4e0227c3db22


More information about the ckan-changes mailing list