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