Skip to content

Commit

Permalink
[#3022] Pass package_type to IDatasetForm methods
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Nov 27, 2012
1 parent c81ee8f commit d94a06c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ckan/controllers/package.py
Expand Up @@ -451,7 +451,7 @@ def new(self, data=None, errors=None, error_summary=None):
abort(401, _('Unauthorized to create a package'))

if context['save'] and not data:
return self._save_new(context)
return self._save_new(context, package_type=package_type)

data = data or clean_dict(unflatten(tuplize_dict(parse_params(
request.params, ignore_keys=CACHE_PARAMETERS))))
Expand Down Expand Up @@ -481,7 +481,8 @@ def new(self, data=None, errors=None, error_summary=None):
'action': 'new', 'stage': stage}
c.errors_json = json.dumps(errors)

self._setup_template_variables(context, {'id': id})
self._setup_template_variables(context, {'id': id},
package_type=package_type)

# TODO: This check is to maintain backwards compatibility with the
# old way of creating custom forms. This behaviour is now deprecated.
Expand Down

0 comments on commit d94a06c

Please sign in to comment.