Skip to content

Commit

Permalink
Fix 0006 db migrations to avoid overwriting org name with empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
noliveleger committed Nov 4, 2024
1 parent 58163fd commit f51bdfe
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ def update_organization_names(apps, schema_editor):
except (KeyError, AttributeError):
continue

organization.name = organization_name
organizations.append(organization)
if organization_name:
organization.name = organization_name
organizations.append(organization)

Organization.objects.bulk_update(organizations, ['name'])
if organizations:
Organization.objects.bulk_update(organizations, ['name'])


def noop(apps, schema_editor):
Expand Down

0 comments on commit f51bdfe

Please sign in to comment.