File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33from django .contrib .auth .models import AnonymousUser
44
55from annotation .models import (
6+ BaseAnnotation ,
67 KnowledgeBaseAnnotation ,
78 Label ,
89 LabelAnnotation ,
@@ -46,16 +47,9 @@ def get_removable(self, annotation) -> bool:
4647 raise NotImplementedError ("Subclasses must implement get_removable method." )
4748
4849 def get_createdBy (self , annotation ) -> str | None :
49- """
50- Return the full name of the user who created the annotation or a
51- default string if not available.
52- """
53- default = "unknown user"
54- if annotation .created_by is None :
55- return default
56-
57- created_by_name = f"{ annotation .created_by .first_name } { annotation .created_by .last_name } " .strip ()
58- return created_by_name if created_by_name else default
50+ """Returns the full name of the user who created the annotation."""
51+ return annotation .created_by .get_full_name ()
52+
5953
6054
6155class KnowledgeBaseAnnotationSerializer (AnnotationBaseSerializer ):
You can’t perform that action at this time.
0 commit comments