Don’t wipe domains when updating other attributes

The domains for an organisation should only be updated (or wiped) if a
new list is explicitly passed in by the admin app.
This commit is contained in:
Chris Hill-Scott
2019-03-20 12:21:25 +00:00
parent 28ea75728c
commit 9783ab56b7
2 changed files with 24 additions and 1 deletions

View File

@@ -53,7 +53,7 @@ def dao_create_organisation(organisation):
@transactional
def dao_update_organisation(organisation_id, **kwargs):
domains = kwargs.pop('domains', [])
domains = kwargs.pop('domains', None)
organisation = Organisation.query.filter_by(id=organisation_id).update(
kwargs