(uids, **kwargs)
return
Set post rank the current timestamp
Set post rank the current timestamp
Set post rank the current timestamp
def bump(uids, **kwargs):
    """
    Set post rank the current timestamp
    """

    top = Post.objects.filter(status=Post.OPEN, is_toplevel=True).order_by("-rank")[2:6]

    top = random.choice(list(top))
    rank = top.rank
    user = User.objects.filter(is_superuser=True).first()

    if not uids:

        # Pick open questions from given time period.
        since = util.now() - timedelta(weeks=10)
        query = Post.objects.filter(type=Post.QUESTION,
                                    status=Post.OPEN,
                                    reply_count=0,
                                    creation_date__gt=since)

        # Get valid uids
        query = query.values_list("uid", flat=True)
        uids = [p for p in query]

        # Pick a random uid
        uids = [random.choice(uids)]
    else:
        uids = uids.split(',')

    Post.objects.filter(uid__in=uids).update(rank=rank, lastedit_user=user)
    logger.debug(f'uids={uids} bumped')

    return
def bump ( uids , * * kwargs ) : top = Post . objects . filter ( status = Post . OPEN , is_toplevel = True ) . order_by ( "-rank" ) [ 2 : 6 ] top = random . choice ( list ( top ) ) rank = top . rank user = User . objects . filter ( is_superuser = True ) . first ( ) if not uids : # Pick open questions from given time period. since = util . now ( ) - timedelta ( weeks = 10 ) query = Post . objects . filter ( type = Post . QUESTION , status = Post . OPEN , reply_count = 0 , creation_date__gt = since ) # Get valid uids query = query . values_list ( "uid" , flat = True ) uids = [ p for p in query ] # Pick a random uid uids = [ random . choice ( uids ) ] else : uids = uids . split ( ',' ) Post . objects . filter ( uid__in = uids ) . update ( rank = rank , lastedit_user = user ) logger . debug ( f'uids={uids} bumped' ) return