diff farol/main.py @ 102:65341d05a8f8

Spawn a Modal when loading a doc, and another one is already loaded
author Benoît Allard <benoit.allard@greenbone.net>
date Tue, 14 Oct 2014 10:25:43 +0200
parents ce49bd1512dd
children 67c4b299736e
line wrap: on
line diff
--- a/farol/main.py	Tue Oct 14 10:23:08 2014 +0200
+++ b/farol/main.py	Tue Oct 14 10:25:43 2014 +0200
@@ -80,7 +80,8 @@
         error = None
     except ValidationError as ve:
         error = ve
-    return dict(has_current=True, vulnerabilities=vulns, products=prods, error=error)
+    return dict(has_current=True, vulnerabilities=vulns, products=prods,
+                error=error, current_id=cvrf.getDocId())
 
 @app.template_filter('secure_filename')
 def makeId(string):
@@ -140,10 +141,7 @@
 @app.route('/new', methods=['GET', 'POST'])
 def new():
     if request.method != 'POST':
-        current_id = None
-        if has_current():
-            current_id = get_current().getDocId()
-        return render_template('new.j2', has_document=has_current(), now=utcnow(), current_id=current_id)
+        return render_template('new.j2', has_document=has_current(), now=utcnow())
 
     if 'rhsa' in request.form:
         set_RHSA(request.form['id'])

http://farol.wald.intevation.org