Skip to content

Commit

Permalink
[#2939] Fix owner_org validator
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Nov 15, 2012
1 parent 50b16cf commit 4009b4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ckan/logic/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def owner_org_validator(key, data, errors, context):
raise StopOnError

model = context['model']
try:
group_id = model.Group.get(value).id
except NotFound:
group = model.Group.get(value)
if not group:
raise Invalid('Group does not exist')
group_id = group.id
user = context['user']
user = model.User.get(user)
if not(user.sysadmin or user.is_in_group(group_id)):
Expand Down

0 comments on commit 4009b4a

Please sign in to comment.