From 264feaae41e223616c898c1a0001e3375bb4b6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Sat, 16 Nov 2024 09:37:14 +0100 Subject: [PATCH] fix(gitexporter): avoid manually building query string --- weblate/gitexport/tests.py | 4 ++-- weblate/gitexport/views.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/weblate/gitexport/tests.py b/weblate/gitexport/tests.py index f0a3d5bee6f3..aebaef13b9d2 100644 --- a/weblate/gitexport/tests.py +++ b/weblate/gitexport/tests.py @@ -84,7 +84,7 @@ def test_git_info(self) -> None: def git_receive(self, **kwargs): return self.client.get( self.get_git_url(), - QUERY_STRING="?service=git-upload-pack", + {"service": "git-upload-pack"}, CONTENT_TYPE="application/x-git-upload-pack-advertisement", **kwargs, ) @@ -93,7 +93,7 @@ def test_redirect_link(self) -> None: linked = self.create_link_existing() response = self.client.get( self.get_git_url(component=linked), - QUERY_STRING="?service=git-upload-pack", + {"service": "git-upload-pack"}, CONTENT_TYPE="application/x-git-upload-pack-advertisement", ) self.assertRedirects( diff --git a/weblate/gitexport/views.py b/weblate/gitexport/views.py index ba73647d970f..224f8aab4bbc 100644 --- a/weblate/gitexport/views.py +++ b/weblate/gitexport/views.py @@ -95,7 +95,7 @@ def git_export(request: AuthenticatedHttpRequest, path, git_request): raise Http404("Not a git repository") if obj.is_repo_link: return redirect( - "{}{}".format( + "{}?{}".format( reverse( "git-export", kwargs={