def autohide_new_release_handler(sender, instance, created, *args, **kwargs):
    """ Autohide other releases on the creation of a new release when the 
    package 'auto-hide' is True"""
    if not created or not instance.package.auto_hide:
        return
    for release in instance.package.releases.exclude(pk=instance.pk).filter(
        hidden=False):
        release.hidden = True
        release.save()
    if instance.hidden:
        instance.hidden = False
        instance.save()
