def release_activity(request, course_slug, activity_slug):
    """
    Bump activity status: INVI -> URLS, URLS -> RLS.
    """
    course = get_object_or_404(CourseOffering, slug=course_slug)
    activity = get_object_or_404(Activity, slug=activity_slug, offering=course, deleted=False)
    if request.method == 'POST':
        if activity.status == "INVI":
            activity.status = "URLS"
            activity.save(entered_by=request.user.username)
            messages.success(request, 'Activity made visible to students (but grades are still unreleased).')

            #LOG EVENT#
            l = LogEntry(userid=request.user.username,
                  description=("activity %s made visible") % (activity),
                  related_object=course)
            l.save()
        elif activity.status == "URLS":
            activity.status = "RLS"
            activity.save(entered_by=request.user.username)
            messages.success(request, 'Grades released to students.')

            #LOG EVENT#
            l = LogEntry(userid=request.user.username,
                  description=("activity %s grades released") % (activity),
                  related_object=course)
            l.save()

        return HttpResponseRedirect(reverse('offering:activity_info', kwargs={'course_slug': course.slug, 'activity_slug': activity.slug}))