Skip to content

Commit

Permalink
remove import
Browse files Browse the repository at this point in the history
  • Loading branch information
priscilawebdev committed Jan 22, 2025
1 parent 086ec74 commit 4adcab5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/sentry/web/client_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import urllib
from collections.abc import Callable, Iterable, Mapping
from functools import cached_property
from typing import Any
Expand Down Expand Up @@ -406,11 +407,17 @@ def should_preload_data(self) -> bool:
# which could cause an error notification (403) to pop up in the user interface.
if self.user and self.request and self.request.path.startswith("accept/"):

member_id = self.request.path.split("/")[1]
invite_state = get_invite_state(int(member_id), None, int(self.user.id), self.request)
request = self.request
http_request: HttpRequest = (
self.request if isinstance(request, HttpRequest) else request._request
)

member_id = http_request.path.split("/")[1]
invite_state = get_invite_state(int(member_id), None, int(self.user.id), http_request)
invitation_link = getattr(invite_state, "invitation_link", None)
accept_path = urllib.parse.urlparse(invitation_link).path

if invitation_link == self.request.get_full_path():
if accept_path == request.path:
return False

return True
Expand Down

0 comments on commit 4adcab5

Please sign in to comment.