Added docstring and code cleanup.
This commit is contained in:
parent
6b93fc5f6c
commit
770bf23f15
1 changed files with 2 additions and 2 deletions
|
@ -11,6 +11,6 @@ from .models import Album, Artist, Game, Song
|
|||
@receiver(pre_save, sender=Song)
|
||||
def update_sorted_fields(sender, instance, **kwargs):
|
||||
if sender == Artist:
|
||||
instance.sorted_full_name = naturalize(getattr(instance, 'full_name'))
|
||||
instance.sorted_full_name = naturalize(instance.full_name)
|
||||
else:
|
||||
instance.sorted_title = naturalize(getattr(instance, 'title'))
|
||||
instance.sorted_title = naturalize(instance.title)
|
||||
|
|
Loading…
Reference in a new issue