Skip to content

Commit

Permalink
feat(feedback): Urls to feedbacks should include the project that the…
Browse files Browse the repository at this point in the history
… feedback is part of (#61169)

Fixes getsentry/team-replay#290
  • Loading branch information
ryan953 authored Dec 8, 2023
1 parent d2f369c commit c796a59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/sentry/models/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,11 @@ def get_absolute_url(
if self.issue_category == GroupCategory.FEEDBACK:
path = f"/organizations/{organization.slug}/feedback/"
slug = {"feedbackSlug": f"{self.project.slug}:{self.id}"}
project = {"project": self.project.id}
params = {
**(params or {}),
**slug,
**project,
}
query = urlencode(params)
return organization.absolute_url(path, query=query)
Expand Down
4 changes: 1 addition & 3 deletions tests/sentry/models/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,7 @@ def test_get_absolute_url_feedback(self):
project = self.create_project(organization=org)
group_id = 23
params = None
expected = (
f"http://testserver/organizations/org1/feedback/?feedbackSlug={project.slug}%3A23"
)
expected = f"http://testserver/organizations/org1/feedback/?feedbackSlug={project.slug}%3A23&project={project.id}"

group = self.create_group(id=group_id, project=project, type=FeedbackGroup.type_id)
actual = group.get_absolute_url(params)
Expand Down

0 comments on commit c796a59

Please sign in to comment.