[ckan-changes] commit/ckan: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Fri Jun 10 15:15:38 UTC 2011
2 new changesets in ckan:
http://bitbucket.org/okfn/ckan/changeset/a9522899cb75/
changeset: a9522899cb75
branch: release-v1.4.1
user: kindly
date: 2011-06-10 17:14:21
summary: [controller] make sure save only gets information in post request
affected #: 1 file (5 bytes)
--- a/ckan/controllers/package.py Thu Jun 09 22:49:46 2011 +0100
+++ b/ckan/controllers/package.py Fri Jun 10 16:14:21 2011 +0100
@@ -324,7 +324,6 @@
if (context['save'] or context['preview']) and not data:
return self._save_edit(id, context)
-
try:
old_data = get.package_show(context)
schema = self._db_to_form_schema()
@@ -352,7 +351,7 @@
def _save_new(self, context):
try:
data_dict = clean_dict(unflatten(
- tuplize_dict(parse_params(request.params))))
+ tuplize_dict(parse_params(request.POST))))
self._check_data_dict(data_dict)
context['message'] = data_dict.get('log_message', '')
pkg = create.package_create(data_dict, context)
@@ -378,7 +377,7 @@
def _save_edit(self, id, context):
try:
data_dict = clean_dict(unflatten(
- tuplize_dict(parse_params(request.params))))
+ tuplize_dict(parse_params(request.POST))))
self._check_data_dict(data_dict)
context['message'] = data_dict.get('log_message', '')
pkg = update.package_update(data_dict, context)
http://bitbucket.org/okfn/ckan/changeset/05fbe9d4e5e7/
changeset: 05fbe9d4e5e7
branch: release-v1.4.1
user: kindly
date: 2011-06-10 17:15:14
summary: [merge] merge default branch
affected #: 1 file (183 bytes)
--- a/ckan/tests/functional/test_package.py Fri Jun 10 16:14:21 2011 +0100
+++ b/ckan/tests/functional/test_package.py Fri Jun 10 16:15:14 2011 +0100
@@ -6,6 +6,7 @@
from genshi.core import escape as genshi_escape
from difflib import unified_diff
from nose.plugins.skip import SkipTest
+from nose.tools import assert_equal
from ckan.tests import *
from ckan.tests import search_related
@@ -918,18 +919,11 @@
def test_new_with_params_1(self):
offset = url_for(controller='package', action='new',
- url='http://xxx.org')
+ url='http://xxx.org', name='xxx.org')
res = self.app.get(offset)
form = res.forms['package-edit']
- form['url'].value == 'http://xxx.org/'
- form['name'].value == 'xxx.org'
-
- def test_new_with_params_2(self):
- offset = url_for(controller='package', action='new',
- url='http://www.xxx.org')
- res = self.app.get(offset)
- form = res.forms['package-edit']
- form['name'].value == 'xxx.org'
+ assert_equal(form['url'].value, 'http://xxx.org')
+ assert_equal(form['name'].value, 'xxx.org')
def test_new_without_resource(self):
# new package
Repository URL: https://bitbucket.org/okfn/ckan/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the ckan-changes
mailing list