Skip to content

Commit

Permalink
[#707] Small _group_or_org_purge refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Jun 27, 2013
1 parent 288050e commit 7a9f64b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ckan/logic/action/delete.py
Expand Up @@ -291,16 +291,14 @@ def _group_or_org_purge(context, data_dict, is_org=False):
'''
model = context['model']
id = _get_or_bust(data_dict, 'id')
if is_org:
group_or_org = 'organization'
else:
group_or_org = 'group'

group = model.Group.get(id)
context['group'] = group
if group is None:
raise NotFound('{group_or_org} was not found'.format(
group_or_org=group_or_org.capitalize()))
if is_org:
raise NotFound('Organization was not found')
else:
raise NotFound('Group was not found')

if is_org:
_check_access('organization_purge', context, data_dict)
Expand Down

0 comments on commit 7a9f64b

Please sign in to comment.