MCPcopy Create free account
hub / github.com/Flagsmith/flagsmith / organisation_has_got_feature

Function organisation_has_got_feature

api/features/views.py:1147–1164  ·  view source on GitHub ↗

Helper method to set flag against organisation to confirm that they've requested their feature states for analytics purposes :param request: HTTP request :return: True if value set. None otherwise.

(request, organisation)

Source from the content-addressed store, hash-verified

1145
1146
1147def organisation_has_got_feature(request, organisation): # type: ignore[no-untyped-def]
1148 """
1149 Helper method to set flag against organisation to confirm that they've requested their
1150 feature states for analytics purposes
1151
1152 :param request: HTTP request
1153 :return: True if value set. None otherwise.
1154 """
1155 if organisation.has_requested_features:
1156 return None
1157
1158 referer = request.META.get("HTTP_REFERER")
1159 if not referer or "bullet-train.io" in referer:
1160 return None
1161 else:
1162 organisation.has_requested_features = True
1163 organisation.save()
1164 return True
1165
1166
1167@extend_schema(

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…