Skip to content

Commit

Permalink
[#509] Test fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes authored and amercader committed Apr 15, 2013
1 parent f6491c0 commit 6897d5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckan/lib/dictization/model_save.py
Expand Up @@ -229,7 +229,8 @@ def package_membership_list_save(group_dicts, package, context):
group = session.query(model.Group).get(id)
else:
group = session.query(model.Group).filter_by(name=name).first()
groups.add(group)
if group:
groups.add(group)

## need to flush so we can get out the package id
model.Session.flush()
Expand Down
1 change: 1 addition & 0 deletions ckan/tests/lib/test_dictization.py
Expand Up @@ -359,6 +359,7 @@ def test_07_table_simple_save(self):
def test_08_package_save(self):

context = {"model": model,
"user": 'testsysadmin',
"session": model.Session}

anna1 = model.Session.query(model.Package).filter_by(name='annakarenina').one()
Expand Down

0 comments on commit 6897d5f

Please sign in to comment.