I lied--now I added the docstring.

This commit is contained in:
Josh Washburne 2018-01-08 09:39:55 -05:00
parent 770bf23f15
commit 53437d6d96

View file

@ -10,6 +10,11 @@ from .models import Album, Artist, Game, Song
@receiver(pre_save, sender=Game) @receiver(pre_save, sender=Game)
@receiver(pre_save, sender=Song) @receiver(pre_save, sender=Song)
def update_sorted_fields(sender, instance, **kwargs): def update_sorted_fields(sender, instance, **kwargs):
"""
Whenever the name or title of a radio model object is created/modified, we
want to make sure we update the sorted field with the naturalized data for
sorting.
"""
if sender == Artist: if sender == Artist:
instance.sorted_full_name = naturalize(instance.full_name) instance.sorted_full_name = naturalize(instance.full_name)
else: else: