diff --git a/django/didgeridoo/currencies/views.py b/django/didgeridoo/currencies/views.py index 5e9b496..43c9d29 100644 --- a/django/didgeridoo/currencies/views.py +++ b/django/didgeridoo/currencies/views.py @@ -16,7 +16,7 @@ def currency_update(request): print('its get method') else: print('its not get method') - currency = request.GET.get('currency', None) + currency = request.GET.get('currency_update', None) data = ExchangeRate.objects.filter( name__name=currency).values( 'exchange_rate_to_chf').latest( diff --git a/django/didgeridoo/static/js/app.js b/django/didgeridoo/static/js/app.js index e9dea69..8bf833f 100644 --- a/django/didgeridoo/static/js/app.js +++ b/django/didgeridoo/static/js/app.js @@ -1,15 +1,13 @@ $("#currency_update").change(function () { - var currency = $(this).val(); + var currency_update = $(this).val(); $.ajax({ url: '/ajax/currency_update/', data: { - 'currency': currency + 'currency_update': currency_update }, dataType: 'json', success: function (data) { - if (data.is_taken) { - alert("es pop auf! --dies kommt von: static/js/app.js--."); - } + alert("es pop auf! --dies kommt von: static/js/app.js--.", data); } }); }); diff --git a/django/didgeridoo/webshop/templates/webshop/nav.html b/django/didgeridoo/webshop/templates/webshop/nav.html index f009520..bb3e269 100644 --- a/django/didgeridoo/webshop/templates/webshop/nav.html +++ b/django/didgeridoo/webshop/templates/webshop/nav.html @@ -28,6 +28,9 @@ +