Skip to content

Commit 06f65ec

Browse files
Ensure command can run successfully in sandbox env where target_env comes through as impl (#1590)
1 parent 3728566 commit 06f65ec

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

apps/dot_ext/management/commands/apply_default_scopes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def _display_scopes(self, scopes, label):
2121
self.stdout.write()
2222

2323
def handle(self, *args, **options):
24-
if os.getenv('TARGET_ENV') not in [None, 'local', 'test', 'sbx']:
25-
raise CommandError('Target environment not in [None, "local", "test", "sbx"].')
24+
if os.getenv('TARGET_ENV') not in [None, 'local', 'test', 'sbx', 'impl']:
25+
raise CommandError('Target environment not in [None, "local", "test", "sbx", "impl"].')
2626

2727
default_scopes = ProtectedCapability.objects.filter(default__exact=True)
2828
demographic_scopes = ProtectedCapability.objects.filter(slug__in=BENE_PERSONAL_INFO_SCOPES)

apps/dot_ext/tests/test_apply_default_scopes_command.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ def test_will_not_run_with_target_env_prod(self):
1717
"""
1818
Assert that the command fails when running with TARGET_ENV==prod.
1919
"""
20-
with self.assertRaisesMessage(CommandError, 'Target environment not in [None, "local", "test", "sbx"].'):
20+
with self.assertRaisesMessage(
21+
CommandError, 'Target environment not in [None, "local", "test", "sbx", "impl"].'
22+
):
2123
call_command('apply_default_scopes')
2224

2325
def test_app_no_scopes(self):

0 commit comments

Comments
 (0)