Skip to content

Commit 22a78ba

Browse files
committed
deps: Bump openfeature-provider-flagsmith to 0.1.6
1 parent 4caa029 commit 22a78ba

5 files changed

Lines changed: 28 additions & 25 deletions

File tree

api/organisations/task_helpers.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from app_analytics.analytics_db_service import get_total_events_count
1111
from app_analytics.influxdb_wrapper import get_current_api_usage
1212
from core.helpers import get_current_site_url
13-
from integrations.flagsmith.client import get_client
13+
from integrations.flagsmith.client import get_openfeature_client
1414
from organisations.models import (
1515
Organisation,
1616
OrganisationAPIUsageNotification,
@@ -128,13 +128,13 @@ def handle_api_usage_notification_for_organisation(organisation: Organisation) -
128128

129129
allowed_api_calls = subscription_cache.allowed_30d_api_calls
130130

131-
flagsmith_client = get_client("local", local_eval=True)
132-
flags = flagsmith_client.get_identity_flags(
133-
organisation.flagsmith_identifier,
134-
traits=organisation.flagsmith_on_flagsmith_api_traits,
135-
)
131+
openfeature_client = get_openfeature_client()
136132
# TODO: Default to get_total_events_count — https://github.com/Flagsmith/flagsmith/issues/6985
137-
if flags.is_feature_enabled("get_current_api_usage_deprecated"): # pragma: no cover
133+
if openfeature_client.get_boolean_value(
134+
"get_current_api_usage_deprecated",
135+
default_value=False,
136+
evaluation_context=organisation.openfeature_evaluation_context,
137+
): # pragma: no cover
138138
api_usage = get_total_events_count(organisation, period_starts_at)
139139
else:
140140
api_usage = get_current_api_usage(organisation.id, period_starts_at)

api/organisations/tasks.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,10 @@ def charge_for_api_call_count_overages(): # type: ignore[no-untyped-def]
209209

210210
subscription_cache = organisation.subscription_information_cache
211211
# TODO: Default to get_total_events_count — https://github.com/Flagsmith/flagsmith/issues/6985
212-
if flags.is_feature_enabled(
213-
"get_current_api_usage_deprecated"
212+
if openfeature_client.get_boolean_value(
213+
"get_current_api_usage_deprecated",
214+
default_value=False,
215+
evaluation_context=organisation.openfeature_evaluation_context,
214216
): # pragma: no cover
215217
api_usage = get_total_events_count(
216218
organisation,
@@ -356,8 +358,10 @@ def restrict_use_due_to_api_limit_grace_period_over() -> None:
356358

357359
subscription_cache = organisation.subscription_information_cache
358360
# TODO: Default to get_total_events_count — https://github.com/Flagsmith/flagsmith/issues/6985
359-
if flags.is_feature_enabled(
360-
"get_current_api_usage_deprecated"
361+
if openfeature_client.get_boolean_value(
362+
"get_current_api_usage_deprecated",
363+
default_value=False,
364+
evaluation_context=ctx,
361365
): # pragma: no cover
362366
api_usage = get_total_events_count(
363367
organisation,

api/organisations/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
]
162162

163163
if settings.LICENSING_INSTALLED: # pragma: no cover
164-
from licensing.views import ( # type: ignore[import-not-found,import-untyped,unused-ignore]
164+
from licensing.views import ( # type: ignore[import-not-found,unused-ignore]
165165
create_or_update_licence,
166166
)
167167

api/poetry.lock

Lines changed: 6 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ ignore_missing_imports = true
9494
module = ["saml.*"]
9595
ignore_missing_imports = true
9696

97+
[[tool.mypy.overrides]]
98+
module = ["licensing.*"]
99+
ignore_missing_imports = true
100+
97101
[[tool.mypy.overrides]]
98102
module = ["openfeature_flagsmith.*"]
99103
ignore_missing_imports = true
@@ -162,7 +166,7 @@ pydantic-collections = "^0.6.0"
162166
pyngo = "~2.4.1"
163167
flagsmith = "^5.1.1"
164168
openfeature-sdk = ">=0.6.0,<0.9.0"
165-
openfeature-provider-flagsmith = { git = "https://github.com/danjuv/flagsmith-openfeature-provider-python.git", branch = "fix/flagsmith-5-support" }
169+
openfeature-provider-flagsmith = ">=0.1.6"
166170
python-gnupg = "^0.5.1"
167171
django-redis = "^5.4.0"
168172
pygithub = "~2.8"
@@ -227,7 +231,7 @@ pytest-lazy-fixture = "~0.6.3"
227231
moto = "~4.1.3"
228232
# TODO: move to https://github.com/adamchainz/time-machine
229233
pytest-freezegun = "^0.4.2"
230-
setuptools = "*" # this only exists because pytest-freezegun fails without it
234+
setuptools = "*" # this only exists because pytest-freezegun fails without it
231235
pytest-xdist = "~3.6.1"
232236
pylint = "~2.16.2"
233237
pep8 = "~1.7.1"

0 commit comments

Comments
 (0)