(limit=50)
Remove rejected post herald
Remove rejected post herald
Remove rejected post herald
def remove_declined(limit=50):
    """
    Remove rejected post herald
    """

    declined = SharedLink.objects.filter(status=SharedLink.DECLINED)[:limit]

    # Can not apply .delete() to sliced query set
    SharedLink.objects.filter(pk__in=declined.values_list('pk')).delete()
def remove_declined ( limit = 50 ) : declined = SharedLink . objects . filter ( status = SharedLink . DECLINED ) [ : limit ] # Can not apply .delete() to sliced query set SharedLink . objects . filter ( pk__in = declined . values_list ( 'pk' ) ) . delete ( )