fix: potentional iteration through None (#1043)
Signed-off-by: Vitalii Dmitriev <dmitvitalii@gmail.com>
This commit is contained in:
parent
f89f47ebd3
commit
0f441198d8
|
@ -85,9 +85,10 @@ class AbstractPostForm(forms.ModelForm):
|
|||
abstract = True
|
||||
|
||||
def clean_coauthors(self):
|
||||
coauthors = [coauthor.replace("@", "", 1) for coauthor in self.cleaned_data.get("coauthors")]
|
||||
coauthors = self.cleaned_data.get("coauthors")
|
||||
if not coauthors:
|
||||
return []
|
||||
coauthors = [coauthor.replace("@", "", 1) for coauthor in coauthors]
|
||||
|
||||
seen = set()
|
||||
duplicated_coauthors = [coauthor for coauthor in coauthors if coauthor in seen or seen.add(coauthor)]
|
||||
|
|
Loading…
Reference in New Issue