Minor improvements

This commit is contained in:
Aitor Magán 2014-06-30 13:31:11 +02:00
parent 6d780ac38e
commit f746754c24
2 changed files with 4 additions and 7 deletions

View File

@ -1,6 +1,6 @@
/* Dataset visibility toggler
* When no organization is selected in the org dropdown then set visibility to
* public always and disable dropdown
/* Dataset allowed_users and adquire_url toggler
* allowd_users and adquire_url can only be active when a user attempts to create
* a private dataset outside an organization
*/
this.ckan.module('allowed-users', function ($, _) {

View File

@ -174,10 +174,7 @@ class ControllerTest(unittest.TestCase):
elif dataset_id in not_updatable_datasets and allowed_users is not None and user_datasets['user'] not in allowed_users:
warns.append('Dataset %s: %s' % (dataset_id, ADD_USERS_ERROR))
if len(warns) > 0:
expected_result = json.dumps({'warns': warns})
else:
expected_result = None
expected_result = json.dumps({'warns': warns}) if len(warns) > 0 else None
# Check that the returned result is as expected
self.assertEquals(expected_result, result)