@receiver(post_save, sender=Release)
def promote_latest_release(sender, instance, **kwargs):
 if kwargs.get('raw', False):
  return
 if instance.is_latest:
  Release.objects.filter(version=instance.version).exclude(pk=instance.pk).update(is_latest=False)

@ receiver ( post_save , sender = Release ) def promote_latest_release ( sender , instance , ** kwargs ) : if kwargs . get ( 'raw' , False ) : return if instance . is_latest : Release . objects . filter ( version = instance . version ) . exclude ( pk = instance . pk ) . update ( is_latest = False )
promote this release to be the latest if this flag is set .