Use name field only for author name
It feels janky to remove a more granular name designation, but all these first/last name fields were algorithmically populated by a dubious process of splitting the name by a space character. If it makes sense to have first/last name fields, it should be re-added with some consideration.
This commit is contained in:
@ -21,8 +21,6 @@ class Author(ActivitypubMixin, BookWyrmModel):
|
||||
born = fields.DateTimeField(blank=True, null=True)
|
||||
died = fields.DateTimeField(blank=True, null=True)
|
||||
name = fields.CharField(max_length=255)
|
||||
last_name = models.CharField(max_length=255, blank=True, null=True)
|
||||
first_name = models.CharField(max_length=255, blank=True, null=True)
|
||||
aliases = fields.ArrayField(
|
||||
models.CharField(max_length=255), blank=True, default=list
|
||||
)
|
||||
@ -42,14 +40,4 @@ class Author(ActivitypubMixin, BookWyrmModel):
|
||||
''' editions and works both use "book" instead of model_name '''
|
||||
return 'https://%s/author/%s' % (DOMAIN, self.id)
|
||||
|
||||
@property
|
||||
def display_name(self):
|
||||
''' Helper to return a displayable name'''
|
||||
if self.name:
|
||||
return self.name
|
||||
# don't want to return a spurious space if all of these are None
|
||||
if self.first_name and self.last_name:
|
||||
return self.first_name + ' ' + self.last_name
|
||||
return self.last_name or self.first_name
|
||||
|
||||
activity_serializer = activitypub.Author
|
||||
|
Reference in New Issue
Block a user