From 144605c0d1918799d6bba6a2d1db197540aa8d16 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Mon, 20 Sep 2021 16:38:53 +0200 Subject: [PATCH 31/59] misc: fix no-else-break pylint error (#56982) --- src/authentic2/attributes_ng/engine.py | 2 +- src/authentic2/natural_key.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/authentic2/attributes_ng/engine.py b/src/authentic2/attributes_ng/engine.py index bf23a2c6..d5f35cf0 100644 --- a/src/authentic2/attributes_ng/engine.py +++ b/src/authentic2/attributes_ng/engine.py @@ -60,7 +60,7 @@ def topological_sort(source_and_instances, ctx, raise_on_unsortable=False): unsorted = new_unsorted if len(sorted_list) == len(source_and_instances): # finished ! break - elif count_sorted == len(sorted_list): # no progress ! + if count_sorted == len(sorted_list): # no progress ! if raise_on_unsortable: raise UnsortableError(sorted_list, unsorted) logger = logging.getLogger(__name__) diff --git a/src/authentic2/natural_key.py b/src/authentic2/natural_key.py index 05af722c..9803d617 100644 --- a/src/authentic2/natural_key.py +++ b/src/authentic2/natural_key.py @@ -83,7 +83,7 @@ def get_by_natural_key_json(self, d): if isinstance(field, GenericForeignKey): if isnull and value: break - elif not isnull: + if not isnull: if not value: break try: @@ -105,7 +105,7 @@ def get_by_natural_key_json(self, d): elif field.is_relation: if isnull and value: break - elif not isnull: + if not isnull: if not value: break try: -- 2.30.2