From 21f2da275bb8a5e71857f5721b37a303e740b270 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 02:06:34 +0530 Subject: [PATCH] Refactor unnecessary `else` / `elif` when `if` block has a `return` statement (#34) Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- durin/admin.py | 3 +-- durin/models.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/durin/admin.py b/durin/admin.py index 9cb27c6..5987dc9 100644 --- a/durin/admin.py +++ b/durin/admin.py @@ -46,8 +46,7 @@ def get_fieldsets(self, request, obj=None): }, ), ] - else: - return super().get_fieldsets(request, obj) + return super().get_fieldsets(request, obj) def has_change_permission(self, request, obj=None): """ diff --git a/durin/models.py b/durin/models.py index 7634db5..b0b0f57 100644 --- a/durin/models.py +++ b/durin/models.py @@ -166,8 +166,7 @@ def expires_in(self) -> str: if self.expiry: td = self.expiry - self.created return humanize.naturaldelta(td) - else: - return "N/A" + return "N/A" @property def has_expired(self) -> bool: