ckan/ckan — pull request #1641 by vitorbaptista (2014-04-10 00:54:23+00:00)
Title: resource_create should break when called without URL

The `resource_create` logic action has two required parameters: `package_id`
and `url`. If it's called without `package_id`, it'll complain throwing a
helpful `ValidationError` related to it, as in:

```
ValidationError: {'package_id': [u'Missing value']}
```

But if we call it without an `url`, it'll break for some random reason:

```
...
File "/usr/lib/ckan/default/src/ckan/ckan/logic/action/create.py", line 286, in resource_create
upload.upload(context['package'].resources[-1].id,
IndexError: list index out of range
```

We should have validations in place for `url` as well.