def _refresh_last_active_date(profile):
    ' Update last_active_date if it is more than a day old. '
    now = timezone.now()
    if ((profile.last_active_date is None) or ((now - profile.last_active_date).days > 0)):
        profile.last_active_date = now
        profile.save()
Update last_active_date if it is more than a day old.
def _refresh_last_active_date(profile):
    '  '
    now = timezone.now()
    if ((profile.last_active_date is None) or ((now - profile.last_active_date).days > 0)):
        profile.last_active_date = now
        profile.save()