From e9e5432f5b468bcbe615b394c41b82d89d2b1700 Mon Sep 17 00:00:00 2001 From: Manuel Sommer Date: Tue, 19 Nov 2024 08:13:50 +0100 Subject: [PATCH 1/7] Ruff: Fix FURB189 on bugfix --- dojo/api_v2/serializers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dojo/api_v2/serializers.py b/dojo/api_v2/serializers.py index 6e100f43b57..bc3f76e5bc4 100644 --- a/dojo/api_v2/serializers.py +++ b/dojo/api_v2/serializers.py @@ -1,6 +1,7 @@ import json import logging import re +from collections import UserList from datetime import datetime import six @@ -280,7 +281,7 @@ def _pop_tags(self, validated_data): return (to_be_tagged, validated_data) -class RequestResponseDict(list): +class RequestResponseDict(UserList): def __init__(self, *args, **kwargs): pretty_print = kwargs.pop("pretty_print", True) list.__init__(self, *args, **kwargs) From fe38021caca4b6c9379b097f39f01f30e58e5ac8 Mon Sep 17 00:00:00 2001 From: manuelsommer <47991713+manuel-sommer@users.noreply.github.com> Date: Tue, 19 Nov 2024 20:35:34 +0100 Subject: [PATCH 2/7] Update dojo/api_v2/serializers.py Co-authored-by: Charles Neill <1749665+cneill@users.noreply.github.com> --- dojo/api_v2/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dojo/api_v2/serializers.py b/dojo/api_v2/serializers.py index bc3f76e5bc4..ea516bcbf16 100644 --- a/dojo/api_v2/serializers.py +++ b/dojo/api_v2/serializers.py @@ -284,7 +284,7 @@ def _pop_tags(self, validated_data): class RequestResponseDict(UserList): def __init__(self, *args, **kwargs): pretty_print = kwargs.pop("pretty_print", True) - list.__init__(self, *args, **kwargs) + collections.UserList.__init__(self, *args, **kwargs) self.pretty_print = pretty_print def __add__(self, rhs): From 98e0dc8c9d17cdad56a405302a8e6b5eafdfb9bd Mon Sep 17 00:00:00 2001 From: Manuel Sommer Date: Tue, 19 Nov 2024 21:12:46 +0100 Subject: [PATCH 3/7] fix --- dojo/api_v2/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dojo/api_v2/serializers.py b/dojo/api_v2/serializers.py index ea516bcbf16..99500c46357 100644 --- a/dojo/api_v2/serializers.py +++ b/dojo/api_v2/serializers.py @@ -284,7 +284,7 @@ def _pop_tags(self, validated_data): class RequestResponseDict(UserList): def __init__(self, *args, **kwargs): pretty_print = kwargs.pop("pretty_print", True) - collections.UserList.__init__(self, *args, **kwargs) + UserList.__init__(self, *args, **kwargs) self.pretty_print = pretty_print def __add__(self, rhs): From 0b0840c1bb4e1635b4dedb2e66ab53703a21805e Mon Sep 17 00:00:00 2001 From: manuelsommer <47991713+manuel-sommer@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:20:32 +0100 Subject: [PATCH 4/7] Update dojo/api_v2/serializers.py Co-authored-by: Charles Neill <1749665+cneill@users.noreply.github.com> --- dojo/api_v2/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dojo/api_v2/serializers.py b/dojo/api_v2/serializers.py index 99500c46357..cda6f1ed835 100644 --- a/dojo/api_v2/serializers.py +++ b/dojo/api_v2/serializers.py @@ -281,7 +281,7 @@ def _pop_tags(self, validated_data): return (to_be_tagged, validated_data) -class RequestResponseDict(UserList): +class RequestResponseDict(collections.UserList): def __init__(self, *args, **kwargs): pretty_print = kwargs.pop("pretty_print", True) UserList.__init__(self, *args, **kwargs) From 456e33ca76bdcfe8624d6a3b5f1628453fcc9906 Mon Sep 17 00:00:00 2001 From: manuelsommer <47991713+manuel-sommer@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:20:42 +0100 Subject: [PATCH 5/7] Update dojo/api_v2/serializers.py Co-authored-by: Charles Neill <1749665+cneill@users.noreply.github.com> --- dojo/api_v2/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dojo/api_v2/serializers.py b/dojo/api_v2/serializers.py index cda6f1ed835..6a08588fb0a 100644 --- a/dojo/api_v2/serializers.py +++ b/dojo/api_v2/serializers.py @@ -284,7 +284,7 @@ def _pop_tags(self, validated_data): class RequestResponseDict(collections.UserList): def __init__(self, *args, **kwargs): pretty_print = kwargs.pop("pretty_print", True) - UserList.__init__(self, *args, **kwargs) + collections.UserList.__init__(self, *args, **kwargs) self.pretty_print = pretty_print def __add__(self, rhs): From 58132707e4c58e8fa981097b34f89cd1087657ce Mon Sep 17 00:00:00 2001 From: manuelsommer <47991713+manuel-sommer@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:20:50 +0100 Subject: [PATCH 6/7] Update dojo/api_v2/serializers.py Co-authored-by: Charles Neill <1749665+cneill@users.noreply.github.com> --- dojo/api_v2/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dojo/api_v2/serializers.py b/dojo/api_v2/serializers.py index 6a08588fb0a..dc3b334b8e8 100644 --- a/dojo/api_v2/serializers.py +++ b/dojo/api_v2/serializers.py @@ -1,7 +1,7 @@ import json import logging import re -from collections import UserList +import collections from datetime import datetime import six From 719dc3fb61c2ccf44c849ef58145219e462051a7 Mon Sep 17 00:00:00 2001 From: Manuel Sommer Date: Thu, 21 Nov 2024 20:21:31 +0100 Subject: [PATCH 7/7] ruff --- dojo/api_v2/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dojo/api_v2/serializers.py b/dojo/api_v2/serializers.py index dc3b334b8e8..00861b1b55f 100644 --- a/dojo/api_v2/serializers.py +++ b/dojo/api_v2/serializers.py @@ -1,7 +1,7 @@ +import collections import json import logging import re -import collections from datetime import datetime import six