Skip to content

Commit

Permalink
fix(upvote): supprimer un parametrage ambigue (#742)
Browse files Browse the repository at this point in the history
## Description

🎸 suite #681
🎸 le parametre `?checked=1` génère du bruit dans la suite de test.
simplification en `?checked`


## Type de changement

🪲 Correction de bug (changement non cassant qui corrige un problème).
🚧 technique
  • Loading branch information
vincentporte authored Aug 6, 2024
1 parent a1a6b73 commit 168df13
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
</p>
</div>
<div class="card-footer text-center">
<a class="btn btn-primary matomo-event" data-matomo-action="topic-create-check" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/forum-[PK of Forum]/topic/create/?checked=1">Je pose ma question à la communauté</a>
<a class="btn btn-primary matomo-event" data-matomo-action="topic-create-check" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/forum-[PK of Forum]/topic/create/?checked">Je pose ma question à la communauté</a>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/forum_conversation/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ def test_get_method(self, client, db, snapshot):
assertContains(
response,
reverse("forum_conversation:topic_create", kwargs={"forum_slug": forum.slug, "forum_pk": forum.pk})
+ "?checked=1",
+ "?checked",
)
content = parse_response_to_soup(response, selector="main", replace_in_href=[forum])
assert str(content) == snapshot(name="topic_create_check")
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/forum_conversation/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class TopicCreateView(FormValidMixin, views.TopicCreateView):

def get(self, request, *args, **kwargs):
forum = self.get_forum()
if forum.is_in_documentation_area or self.request.GET.get("checked"):
if forum.is_in_documentation_area or "checked" in self.request.GET:
return super().get(request, *args, **kwargs)
return redirect(
reverse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h3 class="h4">Je suis un/une professionnel/le de l'insertion, en formation ou e
</p>
</div>
<div class="card-footer text-center">
<a href="{% url 'forum_conversation:topic_create' forum.slug forum.id %}?checked=1"
<a href="{% url 'forum_conversation:topic_create' forum.slug forum.id %}?checked"
class="btn btn-primary matomo-event"
data-matomo-action="topic-create-check"
data-matomo-category="engagement"
Expand Down

0 comments on commit 168df13

Please sign in to comment.