From 7a8a6b08ef46a38397e0d02a3a178f94c3ebb22c Mon Sep 17 00:00:00 2001
From: George Katsikas <giorgakis.katsikas@gmail.com>
Date: Tue, 10 Sep 2024 10:54:04 +0200
Subject: [PATCH] refactor baseaction code to fit in 88 chars

---
 scipost_django/submissions/refereeing_cycles.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/scipost_django/submissions/refereeing_cycles.py b/scipost_django/submissions/refereeing_cycles.py
index 4f875b0ca..d5fab14ef 100644
--- a/scipost_django/submissions/refereeing_cycles.py
+++ b/scipost_django/submissions/refereeing_cycles.py
@@ -105,10 +105,8 @@ class BaseAction:
         return text.format(
             count=len(self._objects),
             object=obj.__class__.__name__,
-            author=obj.author.formal_str
-            if hasattr(obj, "author") and obj.author
-            else "",
-            referee=obj.referee_str if hasattr(obj, "referee_str") else "",
+            author=obj.author.formal_str if getattr(obj, "author", None) else "",
+            referee=getattr(obj, "referee_str", ""),
             days=timedelta.days,
             deadline=deadline.days,
             deadline_min=-deadline.days,
-- 
GitLab