Skip to content

Commit 551254e

Browse files
cursoragentarmenzg
andcommitted
Fix create_organization backward compatibility for region kwarg
Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
1 parent ff45e52 commit 551254e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/sentry/testutils/factories.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,11 @@ def create_organization(name=None, owner=None, cell: Cell | str | None = None, *
382382
if not name:
383383
name = petname.generate(2, " ", letters=10).title()
384384

385+
# Backwards compatibility for callers still passing region=.
386+
region = kwargs.pop("region", None)
387+
if cell is None and region is not None:
388+
cell = region
389+
385390
with contextlib.ExitStack() as ctx:
386391
if cell is None or SiloMode.get_current_mode() == SiloMode.MONOLITH:
387392
cell_name = get_local_cell().name

0 commit comments

Comments
 (0)