From 4525a11d923f3669e46204626b7c1115927d4703 Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Sun, 10 Oct 2021 00:59:08 -0700 Subject: [PATCH] fix(FastAPI): change a deep copy instead of original This was updating offsets and causing unintended behavior. We should be a bit more functional anyway. Signed-off-by: Kevin Morris --- aurweb/util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aurweb/util.py b/aurweb/util.py index 44f711f1..61ed5cfb 100644 --- a/aurweb/util.py +++ b/aurweb/util.py @@ -1,4 +1,5 @@ import base64 +import copy import logging import math import random @@ -127,9 +128,10 @@ def as_timezone(dt: datetime, timezone: str): def extend_query(query: Dict[str, Any], *additions) -> Dict[str, Any]: """ Add additional key value pairs to query. """ + q = copy.copy(query) for k, v in list(additions): - query[k] = v - return query + q[k] = v + return q def to_qs(query: Dict[str, Any]) -> str: