Skip to content

Commit 2e08dbe

Browse files
committed
remove is_bootstrapped
1 parent f9c2342 commit 2e08dbe

File tree

3 files changed

+6
-32
lines changed

3 files changed

+6
-32
lines changed

api/app/utils.py

-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
class SelfHostedData(TypedDict):
1515
has_users: bool
1616
has_logins: bool
17-
is_bootstrapped: bool
1817

1918

2019
class VersionInfo(TypedDict):
@@ -78,10 +77,6 @@ def get_version_info() -> VersionInfo:
7877
version_json["self_hosted_data"] = {
7978
"has_users": FFAdminUser.objects.count() > 0,
8079
"has_logins": FFAdminUser.objects.filter(last_login__isnull=False).exists(),
81-
"is_bootstrapped": (
82-
settings.ALLOW_ADMIN_INITIATION_VIA_CLI is True
83-
and FFAdminUser.objects.filter(email=settings.ADMIN_EMAIL).exists()
84-
),
8580
}
8681

8782
return version_json

api/tests/unit/app/test_unit_app_utils.py

+6-26
Original file line numberDiff line numberDiff line change
@@ -33,54 +33,34 @@ def test_get_version_info(fs: FakeFilesystem, db: None) -> None:
3333
"self_hosted_data": {
3434
"has_users": False,
3535
"has_logins": False,
36-
"is_bootstrapped": False,
3736
},
3837
}
3938

4039

41-
def test_get_version_info_self_hosted_data_is_bootstrapped(
42-
fs: FakeFilesystem, db: None, settings: SettingsWrapper, user_one: FFAdminUser
43-
) -> None:
44-
# Given
45-
fs.create_file("./ENTERPRISE_VERSION")
46-
settings.ALLOW_ADMIN_INITIATION_VIA_CLI = True
47-
settings.ADMIN_EMAIL = user_one.email
48-
49-
# When
50-
result = get_version_info()
51-
52-
# Then
53-
assert result["self_hosted_data"] == {
54-
"is_bootstrapped": True,
55-
"has_logins": False,
56-
"has_users": True,
57-
}
58-
59-
60-
def test_get_version_info_self_hosted_data_users_and_login(
40+
def test_get_version_info_self_hosted_data(
6141
fs: FakeFilesystem, db: None, settings: SettingsWrapper, client: Client
6242
) -> None:
6343
# Given
6444
fs.create_file("./ENTERPRISE_VERSION")
6545

6646
result = get_version_info()
67-
6847
# Let's make sure everything is
6948
# as expected before we create the users
7049
assert result["self_hosted_data"] == {
71-
"is_bootstrapped": False,
7250
"has_logins": False,
7351
"has_users": False,
7452
}
7553
# When
7654
user = FFAdminUser.objects.create(email="user_two@test.com")
7755

56+
# Clear the cache
57+
get_version_info.cache_clear()
58+
7859
client.force_login(user)
7960
result = get_version_info()
8061

8162
# Then
82-
result["self_hosted_data"] == {
83-
"is_bootstrapped": False,
63+
assert result["self_hosted_data"] == {
8464
"has_logins": True,
8565
"has_users": True,
8666
}
@@ -92,6 +72,7 @@ def test_get_version_info_with_missing_files(fs: FakeFilesystem, db: None) -> No
9272

9373
# When
9474
result = get_version_info()
75+
9576
# Then
9677
assert result == {
9778
"ci_commit_sha": "unknown",
@@ -102,7 +83,6 @@ def test_get_version_info_with_missing_files(fs: FakeFilesystem, db: None) -> No
10283
"self_hosted_data": {
10384
"has_users": False,
10485
"has_logins": False,
105-
"is_bootstrapped": False,
10686
},
10787
}
10888

api/tests/unit/app/test_unit_app_views.py

-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ def test_get_version_info(api_client: APIClient, db: None) -> None:
2121
"self_hosted_data": {
2222
"has_users": False,
2323
"has_logins": False,
24-
"is_bootstrapped": False,
2524
},
2625
}

0 commit comments

Comments
 (0)