mirror of
https://github.com/almet/copanier.git
synced 2025-04-28 19:42:37 +02:00
Allow packing to be edited to null.
This commit is contained in:
parent
cfcd3982a1
commit
dd1d9b7b9b
1 changed files with 4 additions and 2 deletions
|
@ -386,13 +386,15 @@ async def edit_product(request, response, delivery_id, producer_id, product_ref)
|
|||
product.url = form.get('url')
|
||||
if form.get('packing'):
|
||||
product.packing = form.int('packing')
|
||||
else:
|
||||
product.packing = None
|
||||
if 'rupture' in form:
|
||||
product.rupture = form.get('rupture')
|
||||
else:
|
||||
product.rupture = None
|
||||
delivery.persist()
|
||||
response.message('Le produit à bien été édité')
|
||||
response.redirect = f'/livraison/{delivery_id}/producteurice/{producer_id}/éditer'
|
||||
response.message('Le produit à bien été modifié')
|
||||
response.redirect = f'/livraison/{delivery_id}/{producer_id}/éditer'
|
||||
|
||||
response.html("edit_product.html", {
|
||||
'delivery': delivery,
|
||||
|
|
Loading…
Reference in a new issue