Exemple #1
0
def detail(request, module_slug, topic_slug):  # noqa
    user = request.user
    if memberkit_facade.has_memberkit_account(user):
        return redirect(facade.get_topic_memberkit_url(topic_slug),
                        permanent=True)
    if memberkit_facade.has_any_subscription(user):
        return redirect(reverse('migrate_to_memberkit'), permanent=True)
    topic = facade.get_topic_with_contents(slug=topic_slug)
    if has_object_permission('access_content', user, topic):
        return render(request, 'topics/topic_detail.html', {'topic': topic})
    return content_landing_page(topic)
Exemple #2
0
def detail(request, slug):
    ctx = {'topic': facade.get_topic_with_contents(slug=slug)}
    return render(request, 'topics/topic_detail.html', context=ctx)
def detail(request, module_slug, topic_slug):  # noqa
    topic = facade.get_topic_with_contents(slug=topic_slug)
    if has_object_permission('access_content', request.user, topic):
        return render(request, 'topics/topic_detail.html', {'topic': topic})
    return content_landing_page(topic)
def old_detail(request, slug):
    topic = facade.get_topic_with_contents(slug=slug)
    return redirect(topic.get_absolute_url(), permanent=True)