Skip to content

Commit

Permalink
[#1226] Return the old behaviour for create_user
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelbabu committed Oct 14, 2013
1 parent c269023 commit 3273ebf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion ckan/logic/auth/create.py
Expand Up @@ -105,7 +105,6 @@ def rating_create(context, data_dict):


@logic.auth_allow_anonymous_access
@logic.auth_sysadmins_check
def user_create(context, data_dict=None):
using_api = 'api_version' in context
create_user_via_api = new_authz.check_config_permission(
Expand Down
6 changes: 2 additions & 4 deletions ckan/tests/functional/api/test_user.py
Expand Up @@ -83,7 +83,7 @@ def teardown_class(cls):

model.repo.rebuild_db()

def test_user_create_api_disabled_sysadmin(self):
def test_user_create_api_enabled_sysadmin(self):
params = {
'name': 'testinganewusersysadmin',
'email': 'testinganewuser@ckan.org',
Expand All @@ -93,7 +93,7 @@ def test_user_create_api_disabled_sysadmin(self):
extra_environ={'Authorization': str(self.sysadmin_user.apikey)},
expect_errors=True)
res_dict = res.json
assert res_dict['success'] is False
assert res_dict['success'] is True

def test_user_create_api_disabled_anon(self):
params = {
Expand Down Expand Up @@ -190,7 +190,6 @@ def test_user_create_api_disabled(self):
'password': 'random',
}
res = self.app.post('/api/3/action/user_create', json.dumps(params),
extra_environ={'Authorization': str(self.sysadmin_user.apikey)},
expect_errors=True)
res_dict = res.json
assert res_dict['success'] is False
Expand Down Expand Up @@ -229,7 +228,6 @@ def test_user_create_api_disabled(self):
'password': 'random',
}
res = self.app.post('/api/3/action/user_create', json.dumps(params),
extra_environ={'Authorization': str(self.sysadmin_user.apikey)},
expect_errors=True)
res_dict = res.json
assert res_dict['success'] is False
Expand Down

0 comments on commit 3273ebf

Please sign in to comment.