From 269a86c25b5240267b14c280a4487cda87bb2b00 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 5 Feb 2024 09:37:13 +0000 Subject: [PATCH] ...? --- generic/mixins.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generic/mixins.py b/generic/mixins.py index cb72090d..f2d668d1 100644 --- a/generic/mixins.py +++ b/generic/mixins.py @@ -1,3 +1,4 @@ +from typing import List from django.contrib.auth.mixins import UserPassesTestMixin from django.contrib.auth.models import User @@ -13,9 +14,9 @@ class AuthorMixin(): requires an author many to many field to be defined on the derived class """ - author: models.ManyToManyField(User) # Is this correct typing? + author = models.ManyToManyField(User) # Corrected typing - def get_author_objects(self) -> list[User]: + def get_author_objects(self) -> List[User]: # Updated type hint """Returns list of author objects""" authors = [i for i in self.author.all()] return authors