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

Method _get_project

api/projects/permissions.py:90–99  ·  view source on GitHub ↗
(self, view)

Source from the content-addressed store, hash-verified

88 )
89
90 def _get_project(self, view) -> Project: # type: ignore[no-untyped-def]
91 try:
92 project_pk = view.kwargs[self._view_kwarg_name]
93 return Project.objects.get(id=project_pk) # type: ignore[no-any-return]
94 except KeyError:
95 raise APIException(
96 "`IsProjectAdmin` incorrectly configured. No project pk found."
97 )
98 except Project.DoesNotExist:
99 raise PermissionDenied()
100
101
102class NestedProjectPermissions(IsAuthenticated):

Callers 1

has_permissionMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected