fix: eliminando vista que no se usa.
This commit is contained in:
		| @@ -2,6 +2,6 @@ | ||||
| <h2>Don Confiao</h2> | ||||
| <ul> | ||||
|     <li><a href='./comprar'>Comprar</a></li> | ||||
|     <li><a href='./compras'>Compras</a></li> | ||||
|     <li><a href='./productos_index'>Productos</a></li> | ||||
|     <li><a href='./productos'>Productos</a></li> | ||||
|     <li><a href='./importar_productos'>Importar Productos</a></li> | ||||
| </ul> | ||||
|   | ||||
| @@ -1,12 +0,0 @@ | ||||
| <form action="{% url 'don_confiao:import_products' %}" method="post"> | ||||
|     {% csrf_token %} | ||||
|     <fieldset> | ||||
|         <legend><h1>Importar Productos</h1></legend> | ||||
|         <div class="error_message"> | ||||
|             {% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} | ||||
|         </div> | ||||
|         <label for="products_csv">Archivo CSV</label> | ||||
|         <input type="file" accept="text/plain, .csv" name="choice" id="products_csv" value="{{ choice.id }}"></br> | ||||
|         <input type="submit" value="Importar"> | ||||
|     </fieldset> | ||||
| </form> | ||||
| @@ -8,6 +8,5 @@ urlpatterns = [ | ||||
|     path("comprar", views.buy, name="buy"), | ||||
|     path("compras", views.purchases, name="purchases"), | ||||
|     path("productos", views.products, name="products"), | ||||
|     path("productos_index", views.products_index, name="products_index"), | ||||
|     path("importar_productos", views.import_products, name="import_products") | ||||
| ] | ||||
|   | ||||
| @@ -38,15 +38,12 @@ def products(request): | ||||
|  | ||||
|     return JsonResponse(rproducts, safe=False) | ||||
|  | ||||
| def products_index(request): | ||||
|     return render(request, 'don_confiao/products_index.html') | ||||
|  | ||||
| def import_products(request): | ||||
|     if request.method == "POST": | ||||
|         form = ImportProductsForm(request.POST, request.FILES) | ||||
|         if form.is_valid(): | ||||
|             handle_import_products_file(request.FILES["csv_file"]) | ||||
|             return HttpResponseRedirect("productos_index") | ||||
|             return HttpResponseRedirect("productos") | ||||
|     else: | ||||
|         form = ImportProductsForm() | ||||
|     return render( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user