ciclos

commit 9dce991c2434b4af849746ce9d4b4a2638c563a5

Author: Pedro Lucas Porcellis <pedrolucasporcellis@gmail.com>

Redirect to the correct place

 src/blueprints/products.py | 4 ++--


diff --git a/src/blueprints/products.py b/src/blueprints/products.py
index 08cb9cc5f377618cc94b099cb11b50748c377a98..bba8e433ac4d683f5fe3629897db670a1cc98b0c 100644
--- a/src/blueprints/products.py
+++ b/src/blueprints/products.py
@@ -55,7 +55,7 @@     return jsonify(product.to_json())
 
 @pro.route("/<id>/balance", methods = ['GET', 'POST'])
 def balance(id):
-    product = Product.query.filter_by(id = id).first()
+    product = Product.query.get(id)
     
     if request.method == "GET":
         return render_template('edit_product_balance.html', product = product, title = "Editar Balanco - Feira Virtual Bem da Terra")
@@ -64,4 +64,4 @@         product.balance.update(
             value = float(request.form.get('value'))
         )
 
-        return redirect(url_for('products.show', id = product.id))
+        return redirect(url_for('products.index'))