Fix: Nom des produits doivent être unique
Some checks failed
Organisation/sgl/pipeline/head There was a failure building this commit
Some checks failed
Organisation/sgl/pipeline/head There was a failure building this commit
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -25,7 +25,11 @@ class Produit(models.Model):
|
||||
("carton", "Carton"),
|
||||
)
|
||||
|
||||
libelle = models.CharField(verbose_name="Libellé", max_length=255)
|
||||
libelle = models.CharField(
|
||||
verbose_name="Libellé",
|
||||
max_length=255,
|
||||
unique=True
|
||||
)
|
||||
quantite_stock = models.PositiveIntegerField(
|
||||
verbose_name="Quantité actuellement en stock"
|
||||
)
|
||||
|
||||
@@ -5,7 +5,6 @@ from django.core.paginator import Paginator
|
||||
from django.db.models import Sum
|
||||
from authentification.models import Profile
|
||||
|
||||
# from django.views.decorators.csrf import csrf_exempt
|
||||
from django.contrib.auth.decorators import login_required
|
||||
|
||||
from django.http import JsonResponse
|
||||
@@ -189,7 +188,6 @@ def detail_produit(request, id_produit):
|
||||
Réponse JSON contenant les détails du produit.
|
||||
|
||||
"""
|
||||
|
||||
detail_produit = calcul_stock_produit(Produit.objects.get(id=id_produit))
|
||||
|
||||
categories = Categorie.objects.all()
|
||||
|
||||
Reference in New Issue
Block a user