From ce409b063437856bf1ae6a681e1c52a9ce5b2841 Mon Sep 17 00:00:00 2001 From: Mirkhalikov Sayfulla Date: Mon, 9 Oct 2023 18:29:14 +0500 Subject: [PATCH 1/2] Removed unnecessary else statements. --- meta/models.py | 3 +-- meta/views.py | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/meta/models.py b/meta/models.py index 5f2916a..1531fce 100644 --- a/meta/models.py +++ b/meta/models.py @@ -127,8 +127,7 @@ def process_value(item): return item(field) except TypeError: return item() - else: - return item + return item if value: try: diff --git a/meta/views.py b/meta/views.py index 74b8679..d06b82b 100644 --- a/meta/views.py +++ b/meta/views.py @@ -186,8 +186,7 @@ def _normalize_media_url(self, url): def image(self): if self.image_object: return self.image_object.get("url") - else: - return self._image + return self._image @image.setter def image(self, image): @@ -245,8 +244,7 @@ def process_item(item): return [process_item(value) for value in item] elif isinstance(item, dict): return {itemkey: process_item(itemvalue) for itemkey, itemvalue in item.items()} - else: - return item + return item schema = {} # object is immediately set here to recursion From 80c82f096b8df120968f12d3a89d55a92dbe11ad Mon Sep 17 00:00:00 2001 From: Mirkhalikov Sayfulla Date: Tue, 10 Oct 2023 09:09:01 +0500 Subject: [PATCH 2/2] Added feature file --- changes/182.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/182.feature diff --git a/changes/182.feature b/changes/182.feature new file mode 100644 index 0000000..0ac479c --- /dev/null +++ b/changes/182.feature @@ -0,0 +1 @@ +Remove useless "else" statements.