def index_view(request, page_app, album_slug=None):
    """
    Display all albums of the app gallery.
    """
    context_instance=RequestContext(request)

    # Index View -- Display all albums
    if not album_slug:
        return render_view('page_gallery_images/index.html',
                           {'object': page_app},
                           RENDER_MEDIAS,
                           context_instance=context_instance)

    # Album View -- Display all images
    else:
        album = get_object_or_404(Album, slug=album_slug)
        # Displaying infos
        infos = {}
        if page_app.show_album_title:
            infos['title'] = album.title
            infos['title_rule'] = page_app.album_title_rule
        # --
        # Save object title in request
        # for plugin 'Breadcrumb'
        # --
        if settings.INSTALLED_APPS in settings.BREADCRUMB_PLUGIN:
            setattr(request, settings.BREADCRUMB_OBJECT_TITLE, album.title)
        # --
        return render_view('page_gallery_images/album.html',
                           {'object': page_app,
                            'infos': infos,
                            'album': album},
                           RENDER_MEDIAS,
                           title=album.title,
                           context_instance=context_instance)
dataset/ETHPy150Open ionyse/ionyweb/ionyweb/page_app/page_gallery_images/views.py/index_view/swapped operands of `in`