don't attempt to add a membership if one is not provided

pull/183/head
Chris Veilleux 2019-06-12 10:33:36 -05:00
parent 4e5bf29eb4
commit 24dbd72f4d
1 changed files with 2 additions and 1 deletions

View File

@ -47,7 +47,8 @@ def add_account(db, **overrides):
acct_repository = AccountRepository(db)
account = build_test_account(**overrides)
account.id = acct_repository.add(account, 'foo')
acct_repository.add_membership(account.id, account.membership)
if account.membership is not None:
acct_repository.add_membership(account.id, account.membership)
return account