changeset 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 9b0fb5ca7eff
children 22d89f53e34c
files farol/cache.py farol/main.py setup.py
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/farol/cache.py	Thu Oct 02 15:40:38 2014 +0200
+++ b/farol/cache.py	Mon Oct 06 11:44:01 2014 +0200
@@ -91,7 +91,7 @@
         abort(403)
     if request.method != 'POST':
         return render_template('cache/save.j2',
-                               id_=get_current()._tracking._identification._id)
+                               id_=get_current().getDocId())
     # Get some kind of filename, and save the cvrf on cache (disk)
     path = secure_filename(request.form['fname'])
     path, _ = os.path.splitext(path)
--- a/farol/main.py	Thu Oct 02 15:40:38 2014 +0200
+++ b/farol/main.py	Mon Oct 06 11:44:01 2014 +0200
@@ -143,7 +143,7 @@
         current_id = None
         cvrf = get_current()
         if has_current():
-            current_id = get_current()._tracking._identification._id
+            current_id = get_current().getDocId()
         return render_template('new.j2', has_document=has_current(), now=utcnow(), current_id=current_id)
 
     if 'rhsa' in request.form:
@@ -184,7 +184,7 @@
     if 'raw' not in request.args:
         return render_template('render.j2', format_=format_, title=cvrf._title, type_=cvrf._type, doc=doc)
     response = make_response(doc)
-    filename = secure_filename(cvrf._tracking._identification._id) + "." + format_
+    filename = secure_filename(cvrf.getDocId()) + "." + format_
     response.headers["content-disposition"] = 'attachement; filename=' + filename
     response.headers["content-type"] = 'text/plain'
     return response
--- a/setup.py	Thu Oct 02 15:40:38 2014 +0200
+++ b/setup.py	Mon Oct 06 11:44:01 2014 +0200
@@ -42,7 +42,7 @@
     license='GPLv2+',
     packages=['farol'],
     scripts=['run_web'],
-    install_requires=['farolluz', 'Flask'],
+    install_requires=['farolluz >= 0.1.1', 'Flask'],
     test_suite='tests',
     # Also install the templates and the static dir
     include_package_data=True,

http://farol.wald.intevation.org