mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 08:21:13 -05:00
Make sure domains are always lowercased
Because otherwise we might get garbage duplicate data.
This commit is contained in:
@@ -59,12 +59,12 @@ def dao_update_organisation(organisation_id, **kwargs):
|
||||
kwargs
|
||||
)
|
||||
|
||||
if domains:
|
||||
if isinstance(domains, list):
|
||||
|
||||
Domain.query.filter_by(organisation_id=organisation_id).delete()
|
||||
|
||||
db.session.bulk_save_objects([
|
||||
Domain(domain=domain, organisation_id=organisation_id)
|
||||
Domain(domain=domain.lower(), organisation_id=organisation_id)
|
||||
for domain in domains
|
||||
])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user