mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2025-07-07 09:44:01 +02:00
Add author note
This commit is contained in:
@ -99,6 +99,10 @@ class MediaAdminForm(ModelForm):
|
||||
self.download_data_openlibrary(isbn)
|
||||
|
||||
if self.cleaned_data['authors']:
|
||||
authors: list = self.cleaned_data['authors']
|
||||
def sort(author):
|
||||
return str(-author.note) + "." + author.name
|
||||
authors.sort(key=sort)
|
||||
author_name = self.cleaned_data['authors'][0].name
|
||||
if ',' not in author_name and ' ' in author_name:
|
||||
author_name = author_name.split(' ')[-1]
|
||||
|
Reference in New Issue
Block a user