From 8af62f77eb522e3fc6db45f8242b7d0de7ddc433 Mon Sep 17 00:00:00 2001
From: SwoopDoable <swoop-doable.0v@icloud.com>
Date: Fri, 13 Sep 2024 11:54:48 +0200
Subject: [PATCH] Fix single author publication bug

---
 scipost_django/journals/models/publication.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scipost_django/journals/models/publication.py b/scipost_django/journals/models/publication.py
index 5ef34f4d9..503d4017c 100644
--- a/scipost_django/journals/models/publication.py
+++ b/scipost_django/journals/models/publication.py
@@ -650,8 +650,9 @@ class Publication(models.Model):
             has_affiliation = re.search("\d", author_text) is not None
             
             delimiter: str = r"\\textsuperscript" if has_supperscript else ","
+            has_delimiter = re.search(delimiter, author_text)
             
-            author = re.findall(rf"(.*?){delimiter}", author_text)[0]
+            author = re.findall(rf"(.*?){delimiter}", author_text)[0] if has_delimiter else author_text
             author_list.append(author)
             
             # If no affiliation is present, we add them all.
-- 
GitLab