prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Баг с пажинацией в разделе «Коммьюнити»
  STR:
  1. Открыть https://vas3k.club/people/
  2. Отфильтровать по первым 4 фильтрам
  3. Перейти на 2 страницу выдачи
  
  ER: Фильтры сохранены
  AR: Фильтры частично потеряны
  
  Видео https://youtu.be/08cz2TOq60A
  
  </issue>
  <code>
  [start of posts/templatetags/query_params.py]
  1 from urllib.parse import urlencode
  2 
  3 from django import template
  4 
  5 register = template.Library()
  6 
  7 
  8 @register.simple_tag(takes_context=True)
  9 def append_query_param(context, **kwargs):
  10     query_params = dict(context.request.GET.items())
  11     query_params.update(kwargs)
  12     return "?" + urlencode(query_params)
  13
  [end of posts/templatetags/query_params.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/posts/templatetags/query_params.py b/posts/templatetags/query_params.py
  --- a/posts/templatetags/query_params.py
  +++ b/posts/templatetags/query_params.py
  @@ -1,4 +1,4 @@
  -from urllib.parse import urlencode
  +from copy import deepcopy
   
   from django import template
   
  @@ -7,6 +7,6 @@
   
   @register.simple_tag(takes_context=True)
   def append_query_param(context, **kwargs):
  -    query_params = dict(context.request.GET.items())
  +    query_params = deepcopy(context.request.GET)
       query_params.update(kwargs)
  -    return "?" + urlencode(query_params)
  +    return "?" + query_params.urlencode()
  
verification_info: {"golden_diff": "diff --git a/posts/templatetags/query_params.py b/posts/templatetags/query_params.py\n--- a/posts/templatetags/query_params.py\n+++ b/posts/templatetags/query_params.py\n@@ -1,4 +1,4 @@\n-from urllib.parse import urlencode\n+from copy import deepcopy\n \n from django import template\n \n@@ -7,6 +7,6 @@\n \n @register.simple_tag(takes_context=True)\n def append_query_param(context, **kwargs):\n-    query_params = dict(context.request.GET.items())\n+    query_params = deepcopy(context.request.GET)\n     query_params.update(kwargs)\n-    return \"?\" + urlencode(query_params)\n+    return \"?\" + query_params.urlencode()\n", "issue": "\u0411\u0430\u0433 \u0441 \u043f\u0430\u0436\u0438\u043d\u0430\u0446\u0438\u0435\u0439 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u00ab\u041a\u043e\u043c\u043c\u044c\u044e\u043d\u0438\u0442\u0438\u00bb\nSTR:\r\n1. \u041e\u0442\u043a\u0440\u044b\u0442\u044c https://vas3k.club/people/\r\n2. \u041e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c\u00a0\u043f\u043e \u043f\u0435\u0440\u0432\u044b\u043c 4 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c\r\n3. \u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 2 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432\u044b\u0434\u0430\u0447\u0438\r\n\r\nER: \u0424\u0438\u043b\u044c\u0442\u0440\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b\r\nAR: \u0424\u0438\u043b\u044c\u0442\u0440\u044b \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u044b\r\n\r\n\u0412\u0438\u0434\u0435\u043e\u00a0https://youtu.be/08cz2TOq60A\n", "before_files": [{"content": "from urllib.parse import urlencode\n\nfrom django import template\n\nregister = template.Library()\n\n\n@register.simple_tag(takes_context=True)\ndef append_query_param(context, **kwargs):\n    query_params = dict(context.request.GET.items())\n    query_params.update(kwargs)\n    return \"?\" + urlencode(query_params)\n", "path": "posts/templatetags/query_params.py"}]}