Skip to content

Commit

Permalink
[#2939] Allow create_package auth check to be run directly not via wsgi
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Oct 11, 2012
1 parent b341ec6 commit 9566050
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ckan/logic/auth/create.py
Expand Up @@ -8,7 +8,13 @@

def package_create(context, data_dict=None):
user = context['user']
if not c.user:
# tests sometime call straight in here WTF
try:
context_user = c.user
except TypeError:
context_user = None
if not context_user:

check1 = config.get('ckan.auth.anon_create_dataset', False)
else:
check1 = asbool(config.get('ckan.auth.create_dataset_if_not_in_organization', False)) \
Expand Down

0 comments on commit 9566050

Please sign in to comment.