Remember last-visited Attract project in session

This allows us to keep rendering the "Shots" and "Assets" links in the
sidebar, even when someone navigates away from the project scope.
This commit is contained in:
2017-06-16 12:02:39 +02:00
parent 59505d3233
commit 25fcfea62f
2 changed files with 11 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
import functools
import logging
from flask import Blueprint, render_template, redirect, url_for, request, jsonify
from flask import Blueprint, render_template, redirect, url_for, request, jsonify, session
import flask_login
import werkzeug.exceptions as wz_exceptions
@@ -131,6 +131,8 @@ def attract_project_view(extra_project_projections: dict=None, extension_props=F
if not is_attract:
return error_project_not_setup_for_attract()
session['attract_last_project'] = project.to_dict()
# Check user access.
auth = current_attract.auth
auth.determine_user_rights(str2id(project['_id']))