Mercurial > farol > farol
comparison farol/cache.py @ 33:752b8bfe0baf
Use FarolLuz method to get a document ID (increase dependency version)
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Mon, 06 Oct 2014 11:44:01 +0200 |
parents | eedf9606ab33 |
children | 8a9fdf02bf5b |
comparison
equal
deleted
inserted
replaced
32:9b0fb5ca7eff | 33:752b8bfe0baf |
---|---|
89 current_app.logger.warning('Tried to save although caching is disabled.') | 89 current_app.logger.warning('Tried to save although caching is disabled.') |
90 flash('This version does not allow you to save your document !', 'danger') | 90 flash('This version does not allow you to save your document !', 'danger') |
91 abort(403) | 91 abort(403) |
92 if request.method != 'POST': | 92 if request.method != 'POST': |
93 return render_template('cache/save.j2', | 93 return render_template('cache/save.j2', |
94 id_=get_current()._tracking._identification._id) | 94 id_=get_current().getDocId()) |
95 # Get some kind of filename, and save the cvrf on cache (disk) | 95 # Get some kind of filename, and save the cvrf on cache (disk) |
96 path = secure_filename(request.form['fname']) | 96 path = secure_filename(request.form['fname']) |
97 path, _ = os.path.splitext(path) | 97 path, _ = os.path.splitext(path) |
98 dirname = _caching_dir() | 98 dirname = _caching_dir() |
99 with open(os.path.join(dirname, path + '.xml'), 'wt') as f: | 99 with open(os.path.join(dirname, path + '.xml'), 'wt') as f: |