correction bug chrome

This commit is contained in:
Jonas 12t 2021-10-14 16:22:35 +04:00
parent 65fd60ce26
commit 9aa052b23f
2 changed files with 7 additions and 6 deletions

View File

@ -294,8 +294,8 @@
<div class="field" style="display: none">
<input id="pk_adhesion" type="text" name="pk_adhesion"
required="True"/>
<input id="montant_adhesion" type="number" step="any" name="montant_adhesion"
required="True"/>
{# <input id="montant_adhesion" type="number" step="any" name="montant_adhesion"#}
{# required="True"/>#}
</div>
<div class="field">
@ -399,7 +399,7 @@
{% for tarif in tarifs_adhesion %}
document.getElementById('{{ tarif.name | slugify }}').onclick = function () {
console.log('{{ tarif.name | slugify }}')
document.getElementById("montant_adhesion").value = "{{ tarif.prix }}";
{#document.getElementById("montant_adhesion").value = "{{ tarif.prix }}";#}
document.getElementById("pk_adhesion").value = "{{ tarif.pk }}";
document.getElementById("text_name_adhesion").textContent = "{{ tarif.name }}";
document.getElementById("text_tarif_adhesion").textContent = "{{ tarif.prix }}€";

View File

@ -152,11 +152,12 @@ class index_scan(View):
data = request.POST
print(data)
montant_adhesion = data.get('montant_adhesion')
# montant_adhesion = data.get('montant_adhesion')
pk_adhesion = data.get('pk_adhesion')
montant_recharge = data.get('montant_recharge')
# c'est un paiement
if (montant_adhesion or montant_recharge) and data.get('email'):
if ( pk_adhesion or montant_recharge ) and data.get('email'):
# montant_recharge = data.get('montant_recharge')
ligne_articles = []
metadata = {}
@ -178,7 +179,7 @@ class index_scan(View):
metadata['recharge_carte_montant'] = str(montant_recharge)
if montant_adhesion:
if pk_adhesion:
art_adhesion = Article.objects.get(pk=data.get('pk_adhesion'))
ligne_article_recharge = LigneArticle.objects.create(
article=art_adhesion,